17.05.2015 Views

zl:1 - FTP

zl:1 - FTP

zl:1 - FTP

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

string-capitalize<br />

518<br />

(setq thin-string (make-string 3» => ""<br />

(setq fat-string (make-array 3 :element-type 'character<br />

:initial-element #\A» => "AAA"<br />

(setq new (string-append thin-string fat-string» => "AAA"<br />

(string-fat-p new) => T<br />

For a table of related items: See the section "String Construction" in Symbolies<br />

Common Lisp: Language Concepts.<br />

I<br />

string-capitalize string &key (start 0) (end nil) Function<br />

Returns a copy of string; for every word in the copy, the initial character,<br />

if case-modifiable, is uppercased. All other case-modifiable characters in<br />

the word are lowercased.<br />

For the purposes of string-capitalize, a word is defined as a consecutive<br />

subsequence of alphanumeric characters or digits, delimited at each end either<br />

by a non-alphanumeric character, or by an end of string.<br />

The ke~ords let you select portions of the string argument for uppercasing.<br />

These keyword arguments must be non-negative integer indices into<br />

the string array. The result is always the same length as string, however.<br />

:start Specifies the position within string from which to begin uppercasing<br />

(counting from 0). Default is 0, the first character in the string.<br />

:start must be ~ :end.<br />

:end Specifies the position within string of the first character beyond the<br />

end of the uppercasing operation. Default is nil, that is, the operation<br />

continues to the end of the string.<br />

The destructive version of string-capitalize is the function<br />

nstring-capitalize.<br />

Examples:<br />

(string-capitalize "lexington") => "Lexington"<br />

(string-capitalize 'symbol) => "Symbol"<br />

(string-capitalize "one two three" :start 5) => "one tWo Three"<br />

(string-capitalize "a MIxeD-Up sTrinG" :start 2) => "a Mixed-Up String"<br />

(string-capitalize "a MIxeD-Up sTrinG" :start 2 :end 19) => "a Mixed-Up sTrinG"<br />

(string-capitalize "tom&jerry arenJt in room 15d")<br />

=> "Tom&Jerry ArenJT In Room 15d"<br />

For a table of related items: See the section "String Conversion" in Symbolies<br />

Common Lisp: Language Concepts.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!