Partager via


CHRTRANC( ) Function

Replaces each character in a character expression that matches a character in a second character expression with the corresponding character in a third character expression.

CHRTRANC(cSearched, cSearchFor, cReplacement)

Return Value

Character

Parameters

  • cSearched
    Specifies the expression in which CHRTRANC( ) replaces characters.

  • cSearchFor
    Specifies the expression containing the characters CHRTRANC( ) looks for in cSearched.

  • cReplacement
    Specifies the expression containing the replacement characters.

    If a character in cSearchFor is found in cSearched, the character in cSearched is replaced by a character from cReplacement that's in the same position in cReplacement as the respective character in cSearchFor.

    If cReplacement has fewer characters than cSearchFor, the additional characters in cSearchFor are deleted from cSearched. If cReplacement has more characters than cSearchFor, the additional characters in cReplacement are ignored.

Remarks

CHRTRANC( ) is designed to facilitate working with expressions that contain double-byte characters. Use CHRTRANC( ) to replace single-byte characters with double-byte characters or double-byte characters with single-byte characters. If the expressions contains only single-byte characters, CHRTRANC( ) is equivalent to CHRTRAN( ) .

This function is useful for manipulating double-byte character sets for languages such as Hiragana and Katakana.

See Also

Reference

CHRTRAN( ) Function

STRCONV( ) Function

Creating Character Expressions

Other Resources

Functions

Language Reference (Visual FoxPro)