You need to sign in to do that
Don't have an account?
SFDC_Developer
I have five string which contains some value I need to check if any of them contains value if yes then store them in Another string.
Currently I'm doing this like below:
Is there any other better way of doing this.
Store not null string variable value in another string
Currently I'm doing this like below:
List<string> slist = new List<string>(); String s1 = 'abc'; slist.add(s1); string s2 = 'bcd'; slist.add(s2); string s3 = 'cde'; slist.add(s3); string s4 = 'def'; slist.add(s4); string s5 = 'efg'; slist.add(s4); string allstirng; boolean check; for(String s: slist){ if(!check){ allstirng +=','; } allstirng += s; check = false; }
Is there any other better way of doing this.
You can use like this : Thanks.