Next: , Previous: , Up: The language   [Contents][Index]

5.28 String Functions

Function: translate-string string map

Applies the map to each character in the string. map is also string, each character represents the translation for an ASCII character of that characters position in the string. If the string is less than 256 chars long any undefined characters will remain unchanged.

For example, if string contains the character ‘A’, with ASCII code 65, then it would be replaced by the 65th character in the string map.

Note that the string really is modified, no copy is made

Variable: upcase-table

A translate-string compatible translation map to convert lowercase characters to uppercase characters.

Variable: downcase-table

A map to convert uppercase characters to lowercase.

Variable: flatten-table

A translation map to convert newline characters to spaces.

(translate-string "Foo" upcase-table)
    ⇒ "FOO"

(translate-string "Foo" downcase-table)
    ⇒ "foo"
Function: complete-string template list #!optional ignore-case

Return a string whose beginning matches the string template, and is unique in the set of all strings in list which also match template. If ignore-case is true, all matching ignores case of characters.

(complete-string "foo" '("bar" "foobar" "forbarf" "foobat"))
    ⇒ "fooba"
Function: string-head-eq string-1 string-2

Returns t if string-2 matches the beginning of string-1.

(string-head-eq "foobar" "foo")
    ⇒ t

(string-head-eq "foo" "foobar")
    ⇒ ()
Function: string-upper-case-p string

Return true if string contains no lower case characters.

Function: string-lower-case-p string

Return true if string contains no upper case characters.

Function: string-capitalized-p string

Return true if the first character of string is upper case.

Function: string-upcase string

Return a new string, an upper case copy of string.

Function: string-downcase string

Return a new string, a lower case copy of string.

Function: capitalize-string string

Return a new string, a copy of string with the first character in upper case.

Function: mapconcat function sequence separator

Call function for each member of sequence, concatenating the results. Between each pair of results, insert separator. Return the resulting string.

Function: string->number string &optional radix

Return the number represented by string. If radix is specified, the number is parsed from that base, otherwise base 10 is assumed.

Function: number->string num &optional radix

Return a string containing a printed representation of the number num. If radix is specified, print the number in that base, otherwise print it in base 10.

Next: , Previous: , Up: The language   [Contents][Index]