Dos strtokens

提供:GizmoLabs - だいたい CAD LISP なサイト
構文
(dos_strtokens string splitters [ NoEmptyParts ])


機能
指定された splitters 文字列に基づいて、与えられた文字列をトークンのリストに分割する。
オプションの第3引数 NoEmptyParts が与えられた場合、結果のリストに空の文字列は含まれない。


引数
  • string : トークンのリストに分割する文字列。
  • splitters : 区切り文字として使用する文字を指定する。
  • NoEmptyParts : 空の文字列を含まないかどうかを指定する。T=含まない、nil=含む


戻り値
トークンで分割されたリスト


サンプル
(dos_strtokens "Split this string\nof \ttokens\nand more strings; end." "\t\n ,;" T)
("Split" "this" "string" "of" "tokens" "and" "more" "strings" "end.")

(dos_strtokens "Split this string\nof \ttokens\nand more strings; end." "\t\n ,;" NIL)
("Split" "this" "string" "of" "tokens" "and" "more" "strings" "end.")

(dos_strtokens "Split this string\nof \ttokens\nand more strings; end." "\t\n ,;")
("Split" "this" "string" "of" "" "tokens" "and" "more" "strings" "" "end.")


(dos_strtokens "この文字列\nを\tトークン\nで分割します。" "\t\n ,;" T)
("この文字列" "を" "トークン" "で分割します。")

(dos_strtokens "1 2 3 4 5" " " T) ; 全角スペース
("1" "2" "3" "4" "5")



関連事項