Jump to content

Strip a set of characters from a string: Difference between revisions

{{header|Liberty BASIC}}
({{header|Liberty BASIC}})
Line 212:
print( stripchars( "She was a soul stripper. She took my heart!", "aei" ) )</lang>
 
=={{header|Liberty BASIC}}==
<lang lb>
Print stripchars$("She was a soul stripper. She took my heart!", "aei", 1)
End
 
Function stripchars$(strip$, chars$, num)
For i = 1 To Len(strip$)
If Mid$(strip$, i, 1) <> Mid$(chars$, num, 1) Then
stripchars$ = (stripchars$ + Mid$(strip$, i, 1))
End If
Next i
If (num <= Len(chars$)) Then stripchars$ = stripchars$(stripchars$, chars$, (num + 1))
End Function
</lang>
=={{header|Nemerle}}==
<lang Nemerle>StripChars( text : string, remove : string ) : string
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.