You need to sign in to do that
Don't have an account?
Radhe Shyam.
How To Split String by space and store each character or substring in array
How To Split String by space and store each character or substring in array
I have: String - '(1 OR 2) AND 3'
I need in this way:
String [] filterLogicSplittedbySpace=new String[]{'(', '1', 'OR', '2', ')', 'AND', '3'};
Please guide.
I have: String - '(1 OR 2) AND 3'
I need in this way:
String [] filterLogicSplittedbySpace=new String[]{'(', '1', 'OR', '2', ')', 'AND', '3'};
Please guide.
As per your example, you are not exactly splitting the string by space.Please consider the below code that splits strings by space and saves it in a list of string.
It provides the following output:
The string '(1' and '2)' will be together based if we split based on space whereas in your example they are in different strings.
Hope this helps,
Sandeep
All Answers
As per your example, you are not exactly splitting the string by space.Please consider the below code that splits strings by space and saves it in a list of string.
It provides the following output:
The string '(1' and '2)' will be together based if we split based on space whereas in your example they are in different strings.
Hope this helps,
Sandeep
It works for me. I am Posting another Question :https://developer.salesforce.com/forums?id=9060G000000BiKCQA0