RosettaCodeData/Task/String-length/Forth/string-length-4.fth

9 lines
101 B
Forth

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