String-Handling Functions

AutoCAD AutoLISP & Visual LISP

 
String-Handling Functions
 
 
 

The following table provides summary descriptions of the AutoLISP string-handling functions.

String-handling functions

Function

Description

(read[string])

Returns the first list or atom obtained from a string

(strcasestring [which])

Returns a string where all alphabetic characters have been converted to uppercase or lowercase

(strcat [string1 [string2] ...)

Returns a string that is the concatenation of multiple strings

(strlen [string] ...)

Returns an integer that is the number of characters in a string

(substr string start [length])

Returns a substring of a string

(vl-prin1-to-stringobject)

Returns the string representation of any LISP object as if it were output by the prin1 function

(vl-princ-to-stringobject)

Returns the string representation of any LISP object as if it were output by the princ function

(vl-string->liststring)

Converts a string into a list of character codes

(vl-string-eltstring position)

Returns the ASCII representation of the character at a specified position in a string

(vl-string-left-trimcharacter-setstring)

Removes the specified characters from the beginning of a string

(vl-string-mismatchstr1str2

[pos1pos2ignore-case-p])

Returns the length of the longest common prefix for two strings, starting at specified positions

(vl-string-positionchar-codestr

[start-pos [from-end-p]])

Looks for a character with the specified ASCII code in a string

(vl-string-right-trim

character-setstring)

Removes the specified characters from the end of a string

(vl-string-searchpatternstring [start-pos])

Searches for the specified pattern in a string

(vl-string-substnew-strpatternstring

[start-pos])

Substitutes one string for another, within a string

(vl-string-translate

source-setdest-setstr)

Replaces characters in a string with a specified set of characters

(vl-string-trimchar-setstr)

Removes the specified characters from the beginning and end of a string

(wcmatch string pattern)

Performs a wild-card pattern match on a string