+ Start a Discussion
JeffreyStevensJeffreyStevens 

Split string on paragraph or pilcrow

I have a string that is end of line dilimited with the paragraph (or pilcrow), (ascii 0182).

Does anybody know the character to split on? 

ie for a New+Line dilimited it's ...
list<string> lines = fullText.split('\n');

But for the paragraph - I can't seem to find the right character.
Raj VakatiRaj Vakati
Try like below
 
String fullText ='asdjhjasdasd,asdkjhasdas';
list<string> lines = fullText.split(',');
System.debug('lines'+lines.size());

 
JeffreyStevensJeffreyStevens
Works just fine on splitting on the comma - but I'm trying to split on the Paragraph character ( ¶ ).

When I try it in a developer console - and hard-code a string with the ¶ Char in there - it will split it.  But when I process an attached TXT file - it never seems to find pass the first line.

For example - this works....
string a = 'ab¶cd';
system.debug(JSON.serialize(a.split('¶')));
returning - USER_DEBUG [2]|DEBUG|["ab","cd"]

So - I'd like the fine the equivalant of the "\n" for the Paragraph character.