alexbarfoot
Jan 13, 2006
This code below demonstrates how to remove a character from a string:
original code by Alex Barfoot
'this is a simple code sample that demonstartes how to
'remove a character from the string. A null string exits the loop
'modified by BJ Moore
[reenter]
print "Type in a string and press ENTER."
input a$
print "string:";a$
let s=len(a$)
if s = 0 then end
print "string length:";s
[loop]
print "Type the character you wish to remove from string and press ENTER."
input num$
if len(num$) = 0 then end
n = instr(a$,num$)
if n=0 then goto [figurenot]
a$= left$(a$,n-1) + right$(a$, s-n)
let s=len(a$)
print "string length:";s
print a$
if s<1 then goto [aromved]
goto [loop]
[aromved]
print "all figures removed from string"
goto [reenter]
[figurenot]
print "figure does not exsist"
goto [loop]
original code by Alex Barfoot