Share
 
 

vl-string-translate (AutoLISP)

Replaces characters in a string with a specified set of characters

Supported Platforms: Windows, Mac OS, and Web

Signature

(vl-string-translate source-set dest-set str)
source-set

Type: String

Characters to be matched.

dest-set

Type: String

Characters to be substituted for those in source-set.

str

Type: String

The textual value to be searched and translated.

Return Values

Type: String

The value of str after any substitutions have been made.

Release Information

    Releases:

  • AutoCAD R14 and later on Windows
  • AutoCAD 2011 and later on Mac OS

History

    AutoCAD 2021

  • source-set, dest-set and str arguments previously accepted ASCII text strings or characters, but they now accept Unicode text strings or characters.
  • LISPSYS system variable controls which AutoLISP engine is used and the behavior of the function.
    • 0 - ASCII character support (legacy behavior)
    • 1 or 2 - Unicode character support
    Note: After the value of the LISPSYS system variable has been changed, AutoCAD must be restarted for the change to take affect.

Examples

(vl-string-translate "abcABC" "123123" "A is a, B is b, C is c")
"1 is 1, 2 is 2, 3 is 3"

(vl-string-translate "abc" "123" "A is a, B is b, C is c")
"A is 1, B is 2, C is 3"

Was this information helpful?