LibreOfficeDev 25.8 Help
V3uyt‖Convert a string as specified by a conversion type.
MBgB4‖StrConv(string As String, Conversion As Integer, [ LCID ])
String
c44hy‖string: Any valid string expression.
56k2A‖Conversion: The type of conversion to perform, as defined in the table below.
| Y7PoD‖Conversion | gzFBG‖Value | 6dDST‖Description | 
|---|---|---|
| vbUpperCase | 1 | WmnMz‖Converts Text characters to uppercase. | 
| vbLowerCase | 2 | FMyrC‖Converts Text characters lowercase. | 
| vbProperCase | 3 | 8HoXG‖Converts the first letter of every word in Text to uppercase. | 
| vbWide | 4 | TB54v‖Converts narrow (half-width) characters in Text to wide (full-width) characters. | 
| vbNarrow | 8 | gw9Tg‖Converts wide (full-width) characters in Text to narrow (half-width) characters. | 
| vbKatakana | 16 | fAVnd‖Converts Hiragana characters in Text to Katakana characters. | 
| vbHiragana | 32 | BmF5K‖Converts Katakana characters in Text to Hiragana characters. | 
| vbUnicode | 64 | 2tpZF‖Converts Text characters to Unicode characters using the default code page of the system. | 
| vbFromUnicode | 128 | 4VdbE‖Converts Text characters from Unicode to the default code page of the system. | 
HFmNb‖LCID Optional. The Locale ID in decimal number. If this parameter is omitted, it assumes the system Locale ID. Refer to the file msi-encodinglist.txt for the available LCID values.
Option VBASupport 1
Option Explicit
Sub Test_StrConv
    Print StrConv("abc EFG hij", vbUpperCase) '= "ABC EFG HIJ"
    Print StrConv("abc EFG hij", vbLowerCase) ' =  "abc efg hij"
    Print StrConv("abc EFG hij", vbProperCase) ' = "Abc Efg Hij"
    CdCwD‖REM Converts narrow (single-byte) characters in string to wide
    Print StrConv("ABCDEVB¥ì¥¹¥¥å©", vbWide) ' = "ABCDEVB¥ì¥¹¥¥å©"
    ysFBA‖REM Converts wide (double-byte) characters in string to narrow (single-byte) characters
    Print StrConv("ABCD@$%23'?EG", vbNarrow) ' = "ABCD@$%23'?EG"
    EitmH‖REM Converts Hiragana characters in string to Katakana characters
    Print StrConv("かたかな", vbKatakana) ' = "カタカナ"
    WxMQr‖REM Converts Katakana characters in string to Hiragana characters
    Print StrConv("カタカナ", vbHiragana) '= "かたかな"
    9sG37‖REM  Assumes CP-1252 encoding associated with en-US locale used in unit tests.
    Dim x() As Byte
    x = StrConv("ÉϺ£ÊÐABC", vbFromUnicode)
    gcaG4‖Print UBound(x) ' 8 characters
    Print x(2) ' = 186
    Print StrConv(x, vbUnicode)' = "ÉϺ£ÊÐABC"
End Sub