+ Start a Discussion
tural sadigovtural sadigov 

Apex string internal implementation

Dont think that this is an easy question.

I cant split a string. This is not a regexp issue. It just doesnt work.

 

Heres my scenario, my code sends request to external service which return | delimited string. When I try to split the string it gives 1 part. I have experimented a little and hard coded the return string into my function by copying from debug log and it worked. I have tried to use another string variable and set it to the value of the parameter, no luck.

 

 

PrakashbPrakashb

Are you using the split method?? Can you post the code  where you are doing the string split??

 

sforce2009sforce2009

That should not be the case.. But as you are experiencing .. try this...

1. Take the response string into a string variable  strResp(make sure your debug shows properly)

2. Conctenate strResp with a dummy string.

3. Do the substring for your original response and then split it...

 

I know this is not at all a way to do it, but for a quick solution it should work.... Sometimes things goes a little crazy for no reason!! best of luck!