Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Counting occurences of substring in string
proc string_occurrences {needleString haystackString} { regsub -all $needleString $haystackString {} stripped expr {([string length $haystackString] - [string length $stripped]) / [string length $needleString]} } set haystack "foo foo bar" set needle "foo" puts [string_occurrences $needle $haystack]
run
|
edit
|
history
|
help
0
Huffman code size
proc example {required {default1 А} {default2 Б} args}
Answer
NISP - Planning ID Unit Test
3
binds
zz
Convert a collection to a list
NISP - Wheel Movements 0.1
1