Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

Split in Apex is very similar to Java string split.

the pattern you pass to the split method is not a direct match, its a REGEX pattern. so the pipe symbol | is considered as a Regex input and it splits the string into individual characters.

You can use the below code to get thru this

newString.split('\\|')

here's some other discussions around the same topic

http://stackoverflow.com/questions/6978901/splitting-a-string-usinghttps://stackoverflow.com/questions/6978901/splitting-a-string-using

and a blog post from Lacey on the same topic

Split in Apex is very similar to Java string split.

the pattern you pass to the split method is not a direct match, its a REGEX pattern. so the pipe symbol | is considered as a Regex input and it splits the string into individual characters.

You can use the below code to get thru this

newString.split('\\|')

here's some other discussions around the same topic

http://stackoverflow.com/questions/6978901/splitting-a-string-using

and a blog post from Lacey on the same topic

Split in Apex is very similar to Java string split.

the pattern you pass to the split method is not a direct match, its a REGEX pattern. so the pipe symbol | is considered as a Regex input and it splits the string into individual characters.

You can use the below code to get thru this

newString.split('\\|')

here's some other discussions around the same topic

https://stackoverflow.com/questions/6978901/splitting-a-string-using

and a blog post from Lacey on the same topic

Source Link
Vamsi Krishna Gosu
  • 10.5k
  • 5
  • 33
  • 50

Split in Apex is very similar to Java string split.

the pattern you pass to the split method is not a direct match, its a REGEX pattern. so the pipe symbol | is considered as a Regex input and it splits the string into individual characters.

You can use the below code to get thru this

newString.split('\\|')

here's some other discussions around the same topic

http://stackoverflow.com/questions/6978901/splitting-a-string-using

and a blog post from Lacey on the same topic