One Star

To split a string with a delimiter

Hi,
I want to split a string using a delimiter for example
i have to columns say
A B
CatDogTiger null
ButterJamBread null

i want to split data in col A and update it in col B like:

A B
CatDogTiger Cat Dog Tiger
ButterJamBread Butter Jam Bread
ie i want to split it with space
also every starting letter will be a Capital letter

Please help
Regards,
Ojas
3 REPLIES
Five Stars

Re: To split a string with a delimiter

You don't seem to have a delimiter to split on.
It looks like you want to insert a space before every uppercase letter, except for the initial one?
Here are some suggestions on stackoverflow if this is what you want.
http://stackoverflow.com/questions/14827189/split-based-on-uppercase-in-java
Seventeen Stars

Re: To split a string with a delimiter

hi all,
as tal00000 suggested, you can use tha fact that uppercased letter "delimit" the substring, and split data when caracter is in range of 65-90 from ASCII table.
For that use a regex like
have a look at great site http://www.vogella.com/articles/JavaRegularExpressions/article.html#string , if you need exemple.
regards
laurent
One Star

Re: To split a string with a delimiter

Hi,
Thank you for the reply your post really helped me
Thank you
Regards,
Ojas