ToLocaleUpperCase Method
Returns a string in which all the letter characters are converted to uppercase and adapted to the current region settings in the host environment.
StringVar. tolocaleUpperCase ()
The required stringVar reference is a String object, value, or text.
Description
The toLocaleUpperCase method converts the characters in the string and adapts to the current region settings in the host environment. In most cases, the results are the same as those obtained using the toUpperCase method. However, if the language rules conflict with the conventional Unicode case-sensitivity ing method, the results will be different.
ToLocaleLowerCase Method
Returns a string in which all letter characters are converted to lowercase, taking into account the current region settings of the host environment.
StringVar. tolocaleLowerCase ()
The required stringVar reference is a String object, value, or text.
Description
The toLocaleLowerCase method converts the characters in the string and adapts to the current region settings in the host environment. In most cases, the results are the same as those obtained using the toLowerCase method. However, if the language rules conflict with the conventional Unicode case-sensitivity ing method, the results will be different.
ToLowerCase Method
Returns a string in which letters are converted to lowercase letters.
StrVariable. toLowerCase ()
"String Literal". toLowerCase ()
Description
The toLowerCase method does not affect non-letter characters.
The following example demonstrates the effect of the toLowerCase method:
Var strVariable = "This is a STRING object ";
StrVariable = strVariable. toLowerCase ();
After executing the previous statement, the value of strVariable is:
This is a string object
ToUpperCase Method
Returns a string in which all letters are converted to uppercase letters.
StrVariable. toUpperCase ()
"String Literal". toUpperCase ()
Description
The toUpperCase method does not affect non-letter characters.
Example
The following example demonstrates the effect of the toUpperCase method:
Var strVariable = "This is a STRING object ";
StrVariable = strVariable. toUpperCase ();
After executing the previous statement, the value of strVariable is:
THIS IS A STRING OBJECT
Copy codeThe Code is as follows:
Function UpperFirstLetter (str)
{
Return str. replace (// B/w +/B/g, function (word ){
Return word. substring (0, 1). toUpperCase () +
Word. substring (1 );
});
}