You need to sign in to do that
Don't have an account?
MaheemSam
Split semi colon separated value into list and search in list
Hi,
String Alpha = ' A; B; C; D';
String SearchString = 'A'
I want to split the above string value as
A
B
C
D
Also Please suggest me how to search a string in list.
Thanks
Sudhir
String Alpha = ' A; B; C; D';
String SearchString = 'A'
I want to split the above string value as
A
B
C
D
Also Please suggest me how to search a string in list.
Thanks
Sudhir
but it's simple logic you can get contains value something like this :
Thanks
let me inform if it helps you :)
All Answers
Look at the string methods, mainly split()
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_split
You can search the values by adding them into a Set<> of Strings or a Map, depending on your implementation needs.
Please mark this answer as correct if it helped you.
for split string use below method :
for search any string in list use below code : i hope it helps you.
kindly Let me inform if it helps you and close your query by choosing best answer if you got your right answer so it can helps others
thanks
sfdcmonkey.com
Thanks for the reply need a clarification
convertInSet.contains returns true Is there a way to return value instead of a boolean. Please let me know
Thanks
Sudhir
but it's simple logic you can get contains value something like this :
Thanks
let me inform if it helps you :)