《通链参考手册》


Function STRING-TRIM, STRING-LEFT-TRIM, STRING-RIGHT-TRIM

●语法设定:

string-trim character-bag string => trimmed-string

string-left-trim character-bag string => trimmed-string

string-right-trim character-bag string => trimmed-string

●参数和值:

character-bag---a sequence containing characters.

string---a string designator.

trimmed-string---a string.

●详情:

string-trim returns a substring of string, with all characters in character-bag stripped off the beginning and end. string-left-trim is similar but strips characters off only the beginning; string-right-trim strips off only the end.

If no characters need to be trimmed from the string, then either string itself or a copy of it may be returned, at the discretion of the implementation.

All of these functions observe the fill pointer.

●例子:

 (string-trim "abc" "abcaakaaakabcaaa") =>  "kaaak"
 (string-trim '(#\Space #\Tab #\Newline) " garbanzo beans
        ") =>  "garbanzo beans"
 (string-trim " (*)" " ( *three (silly) words* ) ")
=>  "three (silly) words"

 (string-left-trim "abc" "labcabcabc") =>  "labcabcabc"
 (string-left-trim " (*)" " ( *three (silly) words* ) ")
=>  "three (silly) words* ) "

 (string-right-trim " (*)" " ( *three (silly) words* ) ") 
=>  " ( *three (silly) words"

●副作用: None.

●受制于:

The implementation.

●例外情况: 无。

●更多信息: None.

●说明: 无。


X3J13设计清单非标准部分,可查下面章节:


◇首页 § ◎章节目录 § □内容索引 § ○符号索引 § △术语表 § ※设计草案