You need to sign in to do that
Don't have an account?
RAM R
how can i check name with case insensitive ?
please suggest me if any one knows how can i achieve this requirement.
I want to check name case insensitive.
find below my code.
Public void UpdateStageNameSample(List<Opportunity> oppList){
List<Opportunity> optyList = new List<Opportunity>();
String s = 'valued client';
for(Opportunity opp: oppList){
if(opp.Name.contains(s.toUpperCase())){
opp.StageName = 'Sample';
}
}
}
I want to check name case insensitive.
find below my code.
Public void UpdateStageNameSample(List<Opportunity> oppList){
List<Opportunity> optyList = new List<Opportunity>();
String s = 'valued client';
for(Opportunity opp: oppList){
if(opp.Name.contains(s.toUpperCase())){
opp.StageName = 'Sample';
}
}
}
Public void UpdateStageNameSample(List<Opportunity> oppList)
{
List<Opportunity> optyList = new List<Opportunity>();
for(Opportunity opp: oppList)
{
if(opp.Name.containsIgnoreCase('valued client'))
{
opp.StageName = 'Sample';
}
}
}
All Answers
containsIgnoreCase(substring)
String s = 'hello';
Boolean b = s.containsIgnoreCase('HE');
System.assertEquals( true, b);
Public void UpdateStageNameSample(List<Opportunity> oppList)
{
List<Opportunity> optyList = new List<Opportunity>();
for(Opportunity opp: oppList)
{
if(opp.Name.containsIgnoreCase('valued client'))
{
opp.StageName = 'Sample';
}
}
}