You need to sign in to do that
Don't have an account?
anil Kumar
how to compare two string values in apex
Hi All,
I have to compare two string vales in apex whether they are same vales or not. Could anyone please help me.
String str1 = Pay TV;AVOD;Basic TV;
String str2 = Basic TV;Pay TV;AVOD;
Thanks,
Anil Kumar
I have to compare two string vales in apex whether they are same vales or not. Could anyone please help me.
String str1 = Pay TV;AVOD;Basic TV;
String str2 = Basic TV;Pay TV;AVOD;
Thanks,
Anil Kumar
Hi anil Kumar,
Please find the solution.
All Answers
Greetings!
You can use || operator to compare two strings in apex suggested in the below link:
https://developer.salesforce.com/forums/?id=906F00000008wPRIAY
Kindly mark it as best answer if it helps so that it can help others in the future.
Warm Regards,
Shirisha Pathuri
Try using the String.equals() method within Apex. It does a string comparison but it is case-sensitive. Try using the String.equalsIgnoreCase() method within Apex. It does a string comparison, it is not case-sensitive. Thanks and Regards,
Sachin Arora
www.sachinsf.com
Hi anil Kumar,
Please find the solution.