标签:turn 计数 return div amp name 子串 def fun
1 ;;;name:BF-Str-PatternNum 2 ;;;desc:字符串string中指定子字符串pattern的个数 3 ;;;arg:pattern:要统计其个数的子串 4 ;;;arg:string:字符串,在其中搜索pattern并计数 5 ;;;return:字符串string中,子串pattern的个数 6 ;;;example:(BF-Str-PatternNum "l" "helloworld") 7 (defun BF-Str-PatternNum(pattern string / k) 8 (setq k 0) 9 (while (vl-string-search pattern string) 10 (setq k (1+ k)) 11 (setq string (vl-string-subst "" pattern string)) 12 ) 13 k 14 )
标签:turn 计数 return div amp name 子串 def fun
原文地址:https://www.cnblogs.com/insipid1860/p/12432473.html