Click to See Complete Forum and Search --> : hi, how do you split a string based on its capital letters?


damon2003
05-10-2005, 09:23 AM
Hi,

I have some names for fields with a format like txtFirstName, txtSecondName, etc. I want to add a space before each capital letter using asp.

I know I can use replace(variable, " ", " ") but dont know how to specify a captial letter,
or do you have to use the split function

can anyone help?

thanks a lot

buntine
05-10-2005, 10:36 AM
The first thing that comes to mind is to use regular expressions to pin-point the location of each capital letter within the string and then split it up accordingly.

Regards.

damon2003
05-10-2005, 11:06 AM
hi,
thanks but I have no idea how to do it,

how can it be done?

thanks

wmif
05-10-2005, 04:32 PM
google "asp regular expressions" and try out some samples.

buntine
05-10-2005, 09:36 PM
If you are still stuck after that, come back and we can give you some additional help. :)