Skip to main content
guest
Join | Help | Sign In
Liberty BASIC Community Wiki Home
guest| Join | Help | Sign In
Liberty BASIC Community Wiki
  • Wiki Home
  • Recent Changes
  • Pages and Files
  • Members
  • Home
    • Liberty BASIC FAQ
    • Contests
    • Tutorials
    • Science
    • Shared Code
    • Tips
    • DLLs
    • PublicDomainSprites
    • Member Pages
    • Links
    • Sandbox

Removing characters from strings

Edit 2 4 …
  • 0 Tags
    • No tags
  • Notify
  • RSS
  • Backlinks
  • Source
  • Print
  • Export (PDF)
Older Version Newer Version

alexbarfoot alexbarfoot Jan 12, 2006

This code below demonstrates how to remove a character from a string by type of character:


[reenter]
print "Type in a string and press ENTER."
input a$
print "string:";a$
let s=len(a$)
print "string length:";s
[loop]
print "Type the figure you wish to remove from string and press ENTER."
input num$
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]
wait
[aromved]
print "all figures removed from string"
goto [reenter]
wait
[figurenot]
print "figure does not exsist"
goto [loop]
wait
Help · About · Pricing · Privacy · Terms · Support · Upgrade
Contributions to https://basic.wikispaces.com/ are licensed under a Creative Commons Attribution Share-Alike 2.5 License. Creative Commons Attribution Share-Alike 2.5 License
Portions not contributed by visitors are Copyright 2018 Tangient LLC
TES: The largest network of teachers in the world
Turn off "Getting Started"
  1. Home
  2. ...
Loading...