views:

608

answers:

2

How can I get the Substring in Coldfusion?

ex:- following is the String "Update Tablename set value=something where value2=thisone"

I want to get the Table name from the Str

how is it possible?

Note:- Table name is dynamic(i.e may be any charecters).

Thanks

+4  A: 

updated:

You can probably use result = ListToArray(sql , " ") and then use the result[2]

also i believe you can do ListGetAt(sql, 2, " ")

Sabeen Malik
Well, This works fine when I use Table name only in above QUery.What about if i want to get "value" only in "value=something" or want to get "where value2=thisone" from the above query?
CFUser
then my friend you will have to look into regular expressions to suit your needs. But again i don't think you would be able to have one solution for all scenarios.
Sabeen Malik
A: 

try this also, some times table name should be two words

thanx

An indian CF CODER