Skip to main content

StrConv function (LotusScript Language)

Converts a string to a different case or character set.

Syntax

StrConv ( expr , conversionType )

Elements

expr

A string or numeric expression. A numeric expression is converted to a string.

conversionType

An integer that defines the type of conversion:

Constant nameValueType of conversion
SC_UpperCase1Uppercase
SC_LowerCase2Lowercase
SC_ProperCase3Proper case
SC_Wide4Single byte to double byte
SC_Narrow8Double byte to single byte
SC_Katakana16Hiragana to Katakana
SC_Hiragana32Katakana to Hiragana
SC_NativeDigit256Convert 0-9 to native digits
SC_ArabicDigit512Convert native digits to 0-9

This diagram shows an example of the conversion order.

<img src="strconv.gif" class="- topic/image image" width="422" height="243" alt="Illustrates conversion between SC_Katakana and SC_Narrow" />

Return value

The return value is a variant containing the result of the conversion.

Usage

The valid values for the conversionType elements listed in the preceding table are defined as constants in the file lsconst.lss. If you want to use the constants instead of numbers, include this file in your script.

ConversionType values can be combined (ored) as follows:

  • Any combination of SC_UpperCase, SC_LowerCase, and SC_ProperCase causes SC_ProperCase.
  • Combining SC_Wide and SC_Narrow is illegal.
  • Combining SC_Katakana and SC_Hiragana is illegal.
  • If combined, the following operations occur in the following order: case operation, SC_Wide, SC_Katakana. Case operations are applied to double-byte alphanumeric characters.

If expr is the null string, the result is the null string. If expr is Null, the result is Null.

For proper case, the following numeric character codes are treated as word separators in a string literal: 0 (null), 9 (horizontal tab), 12 (form feed), 32 (space), 0x3000 (double-byte space). The following are treated as separators in a multi-line string: 10 (line feed), 13 (carriage return).

Example