You need to sign in to do that
Don't have an account?

How should i compare two same strings with different casing?
Hi experts,
I need to compare two same strings with different casing.
In java, equating strings is case sensitive. But in apex, it is case insensitive.
How can i force my two same strings with different casing to be not equal?
Example:
In apex:
'Name' == 'name' --> this gives TRUE
I need to force this to FALSE like how it works in java.
Please help me with this.
Thanks in advance,
ces :)
I need to compare two same strings with different casing.
In java, equating strings is case sensitive. But in apex, it is case insensitive.
How can i force my two same strings with different casing to be not equal?
Example:
In apex:
'Name' == 'name' --> this gives TRUE
I need to force this to FALSE like how it works in java.
Please help me with this.
Thanks in advance,
ces :)
For example:
Apex documentation on the String class:
http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content/apex_methods_system_string.htm
All Answers
For example:
Apex documentation on the String class:
http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content/apex_methods_system_string.htm
Hi,
Actually i am make first letter as capital while displaying the list in select options through this code.
for(integer i=0;i<tempList.size();i++)
{
tempList[i]=tempList[i].substring(0,1).toUpperCase()+tempList[i].substring(1,tempList[i].length()) + ' ';
}
tempList.sort();
And while inserting the records it gives error because it does not match the strings. How can i ignore the string type capital and small letters while comparing. Please help me out.
thanks