初稿: 2018-08-09 Thu 10:44
最終更新日: 2018-12-14 Fri 20:44
ホーム | 文書トップ | 目次

org-split-string
文字列をセパレーターにより分割する

 1: (defun org-split-string (string &optional separators)
 2:   "Splits STRING into substrings at SEPARATORS.
 3: 
 4: SEPARATORS is a regular expression.  When nil, it defaults to
 5: \"[ \f\t\n\r\v]+\".
 6: 
 7: Unlike `split-string', matching SEPARATORS at the beginning and
 8: end of string are ignored."
 9:   (let ((separators (or separators "[ \f\t\n\r\v]+")))
10:     (when (string-match (concat "\\`" separators) string)
11:       (setq string (replace-match "" nil nil string)))
12:     (when (string-match (concat separators "\\'") string)
13:       (setq string (replace-match "" nil nil string)))
14:     (split-string string separators)))

日付: 2018-08-09 Thu 10:44

著者: conao

Created: 2018-12-14 Fri 21:04

Validate