You need to sign in to do that
Don't have an account?
DannyK89
String Split
OK so I was trying to split a string with a space in the middle of the string. I use: String [] NewString = tempname.split('\\ '); am I doing something wrong or does this just not work for spaces.
It seems you're escaping the white spaces which is not needed. I tried this and it is working
String S = 'boo and foo';
list<string> lstr = S.split(' ') ; ( just a space in middle of quotes here )
system.debug(lstr.get(2));
Giving correct result , which is foo