Returns a converted string.
StrConv(string, conversion)
The StrConv function syntax has these named arguments:
Part |
Description |
string |
The string expression to be converted. |
conversion |
The sum of values specifying the type of conversion to perform. |
The conversion argument settings are:
Constant |
Value |
Description |
vbUpperCase |
1 |
Converts the string to uppercase characters. |
vbLowerCase |
2 |
Converts the string to lowercase characters. |
vbProperCase |
3 |
Converts the first letter of every word in string to uppercase. |
vbWide* |
4* |
Converts narrow (single-byte) characters in string to wide (double-byte) characters. |
vbNarrow* |
8* |
Converts wide (double-byte) characters in string to narrow (single-byte) characters. |
vbKatakana** |
16** |
Converts Hiragana characters in string to Katakana characters. |
vbHiragana** |
32** |
Converts Katakana characters in string to Hiragana characters. |
vbUnicode*** |
64*** |
Converts the string to Unicode™ using the default code page of the system. |
vbFromUnicode*** |
128*** |
Converts the string from Unicode to the default code page of the system. |
* Applies to Far East locales. ** Applies to Japan only. *** Specifying this bit on the Macintosh or Windows 16-bit systems causes a run-time error. |
Note These constants are specified by Visual Basic for applications. As a result, they may be used anywhere in your code in place of the actual values. Most can be combined (for example vbUpperCase + vbWide) except when they are mutually exclusive (for example vbUnicode + vbFromUnicode). The constants vbWide, vbNarrow, vbKatakana, and vbHiragana cause run-time errors when used in locales where they do not apply.
For proper casing the following are valid word separators: Null (Chr$(0)), horizontal tab (Chr$(9)), linefeed (Chr$(10)), vertical tab (Chr$(11)), form feed (Chr$(12)), carriage return (Chr$(13)), space (SBCS) (Chr$(32)). The actual value for a space varies by country for DBCS.
Chr Function, String Data Type.