RosettaCodeData/Task/String-length/Forth/string-length-4.fth
2023-07-01 13:44:08 -04:00

8 lines
101 B
Forth

: count-utf8 ( zstr -- n )
0
begin
swap dup c@
while
utf8+
swap 1+
repeat drop ;