PDA

View Full Version : Strip a set of characters from a string



zak
14-04-2012, 12:30
http://rosettacode.org/wiki/Strip_a_set_of_characters_from_a_string

Uses "console"
Dim s,str1,rmv As String
str1 = "She was a soul stripper. She took my heart!"
rmv ="aei"
s = Remove$(str1, Any rmv)
PrintL s
WaitKey

John Spikowski
13-01-2015, 11:09
Here is the Script BASIC version of this.



str1 = "She was a soul stripper. She took my heart!"
rmv = "aei"
FOR i = 1 TO LEN(rmv)
str1 = REPLACE(str1, MID(rmv, i, 1), "")
NEXT
PRINT str1,"\n"




jrs@laptop:~/sb/sb22/test$ scriba strip.sb
Sh ws soul strppr. Sh took my hrt!
jrs@laptop:~/sb/sb22/test$

Collin
03-04-2015, 06:16
and since the site are too big, i suggest Eros may create here a new subforum called rosetta code, and the users can post in that forum their possible contributions to different tasks in rosetta code, if the solution approved then it can be posted to rosetta after editing and elaboration.
the contributions can be accumulated through time only.
i have noticed that many Basic forums suffer now from low contributions compared to the previous glory days, i wonder if there are some mysterious alien language there hiding below the horizon abducting them from the Basic language.




NAT

Petr Schreiber
04-04-2015, 10:10
Hi Collin,

this is not something happening just with BASIC. The world is changing - code projects move to GitHub and similar systems with version support.
It makes collaboration much easier.


Petr