You need to sign in to do that
Don't have an account?
Nitin Shukla 26
find some words from the long string in salesforce apex
Hi I have a custom setting which will contain the some part of "Subject", now when I will receive an email I need to compare this custom setting value from the "Subject" of the email. below is the code but Contains function is not working as it works only for Sequencing string.
In below code consider str2 is the custom setting value and str1 is the subject value from the inbound email
string str1= 'As Oy Viherlaaksonranta 9 osoitteenmuutos';
string str2= 'As Oy osoitteenmuutos';
if(str2.contains(str1)){
system.debug('inside if');
}
In below code consider str2 is the custom setting value and str1 is the subject value from the inbound email
string str1= 'As Oy Viherlaaksonranta 9 osoitteenmuutos';
string str2= 'As Oy osoitteenmuutos';
if(str2.contains(str1)){
system.debug('inside if');
}
@Venkateswarlu: In the above case it will return false, because Contains method will return true if it finds the matching string in sequential order.
here if you replace str2 with value "osoitteenmuutos" OR "As Oy" then it will return True. But in my question I have asked how can we get the string in non sequential order (in my case it is As Oy osoitteenmuutos)