You need to sign in to do that
Don't have an account?
Reza Sarwari
Compare 2 dynamic strings
Hello,
i know that should be pretty easy but i can't go ahead.
I have to strings
String1= abcdefg
String2= abcdeXX
Now I need a function which returns true If the first 5 letters of 2 strings are the same returns a boolean.
Is there any way i can do this?
I already read
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_string.htm
but i didnt find it.
You can use the startsWith function to check if a string starts with a particular pattern. Substring will allow you to get at the first 5 letters, so the following should do it: