STRCONV

STRCONV(string, conversion [,LCID])

Returns the text string converted to a specific case or type (Variant / String).


stringThe text string to be converted (String).
conversionThe vbStrConv constant specifying the type of conversion (Integer):
1 = vbUpperCase
2 = vbLowerCase
3 = vbProperCase
4 = vbWide (East Asia)
8 = vbNarrow (East Asia)
16 = vbKatakana (Japan)
32 = vbHiragana (Japan)
64 = vbUnicode (not Mac)
128 = vbFromUnicode (not Mac)
LCID(Optional) Can be used if different from the LocaleID

REMARKS
* This function can be used to convert a string between lowercase, uppercase or propercase.
* The "conversion" value is the sum of the values specifying the conversion you want to make.
* If "LCID" is left blank, then LocalID is the default.
* If "conversion" = vbWide, the text string converts any narrow (single byte) characters to wide (double byte) characters.
* If "conversion" = vbNarrow, the text string converts any wide (double byte) characters to narrow (single byte) characters.
* If "conversion" = vbKatakana, the text string converts from Hiragana characters to Katakana characters.
* If "conversion" = vbHiragana, the text string converts from Katakana characters to Hiragana characters.
* If "conversion" = vbFromUnicode, the text string is converted from Unicode into the default code page of the system.
* You can use the LCASE function to return a text string with all the characters converted to lowercase.
* You can use the STR function to return the text string of a number.
* You can use the STRCOMP function to return the result of a string comparison.
* You can use the STRREVERSE function to return a text string with the characters reversed.
* You can use the UCASE function to return a text string with all the characters converted to uppercase.
* The equivalent .NET function is Microsoft.VisualBasic.Strings.StrConv
* For the Microsoft documentation refer to learn.microsoft.com

Debug.Print StrConv("iN PROPERcase", vbProperCase)         '= "In Propercase"  
Debug.Print StrConv("bETTER sOLUTIONS", vbProperCase) '= "Better Solutions"
Debug.Print StrConv("FREE ONLINE resources", vbProperCase) '= "Free Online Resources"

Debug.Print StrConv("all lowercase", vbUpperCase) '= "ALL LOWERCASE"
Debug.Print StrConv("ALL UPPERCASE", vbLowerCase) '= "all uppercase"
Debug.Print StrConv("123456", vbLowerCase) '= "123456"

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top