10 LET A$="HOW LONG IS A PIECE OF STRING?"
20 LET B$=A$
30 GOSUB 500
40 PRINT "LENGTH IS ";L
100 STOP
500 REM STRING LENGTH
510 LET L=0
520 IF B$="" THEN GO TO 560
530 LET L=L+1
540 LET B$=TL$(B$)
550 GO TO 520
560 RETURN
The B$ variable is used as a buffer (as ZX80 4K ROM BASIC doesn't have the same string handling routines as the 'New ROM') as the original string (A$) is being reduced by one character in the sub routine (line 540).
600 REM GNIRTS ESREVER
610 LET R=0
620 IF R=L THEN RETURN
630 LET R=L
640 IF R<0 THEN RETURN
650 FOR I=0 TO R
660 LET B$=TL$(B$)
670 NEXT I
680 PRINT CHR$(CODE(B$));
690 LET R=R-1
700 LET B$=R$
710 GO TO 640
Adding to the string length listing, it will be used like this: