StrConv (function)

Syntax StrConv (string, conversion)
Description Converts a string based on a conversion parameter.
Comments The StrConv function takes the following named parameters:
Parameter Description
string String expression specifying the string to be converted.
conversion Integer specifying the types of conversions to be performed.
The conversion parameter can be any combination of the following constants:
Constant Value Description
ebUpperCase 1 Converts string to uppercase. This constant is supported on all platforms.
ebLowerCase 2 Converts string to lowercase. This constant is supported on all platforms.
ebProperCase 3 Capitalizes the first letter of each word and lower-cases all the letters. This constant is supported on all platforms.
ebWide 4 Converts narrow characters to wide characters. This constant is supported on Japanese locales only.
ebNarrow 8 Converts wide characters to narrow characters. This constant is supported on Japanese locales only.
ebKatakana 16 Converts Hiragana characters to Katakana characters. This constant is supported on Japanese locales only.
ebHiragana 32 Converts Katakana characters to Hiragana characters. This constant is supported on Japanese locales only.
ebUnicode 64 Converts string from MBCS to UNICODE. (This constant can only be used on platforms supporting UNICODE.)
ebFromUnicode 128 Converts string from UNICODE to MBCS. (This constant can only be used on platforms supporting UNICODE.)
A runtime error is generated when a conversion is requested that is not supported on the current platform. For example, the ebWide and ebNarrow constants can only be used on an MBCS platform. (You can determine platform capabilities using the Basic.Capabilities method.) The following groupings of constants are mutually exclusive and therefore cannot be specified at the same time:
ebUpperCase, ebLowerCase, ebProperCase
ebWide, ebNarrow
ebUnicode, ebFromUnicode
Many of the constants can be combined. For example, ebLowerCase Or ebNarrow. When converting to proper case (i.e., the ebProperCase constant), the following are seen as word delimiters: tab, linefeed, carriage-return, formfeed, vertical tab, space, null.
Example

                           Sub Main()
                             a = InputBox("Type any string:")
                             MsgBox "Upper case: " & StrConv(a,ebUpperCase)
                             MsgBox "Lower case: " & StrConv(a,ebLowerCase)
                             MsgBox "Proper case: " & StrConv(a,ebProperCase)
                             If Basic.Capability(10) And Basic.OS = ebWin16 Then
                               'This is an MBCS locale
                               MsgBox "Narrow: " & StrConv(a,ebNarrow)
                               MsgBox "Wide: " & StrConv(a,ebWide)
                               MsgBox "Katakana: " & StrConv(a,ebKatakana)
                               MsgBox "Hiragana: " & StrConv(a,ebHiragana)
                             End If
                           End Sub
                        
See Also UCase, UCase$ (functions), LCase, LCase$ (functions), Basic.Capability (method)