posted Mar 6, 2018, 12:34 PM by Konstantinovich Samuel   [ updated Mar 7, 2018, 5:56 AM ]
HW: Complete up to codingbat "Removal from strings"

challenging problems:
Super Challenging (many of them)

1. removeCharFromString(s,c) accepts a string and a character, then returns the string with all instances of that character removed. (Hint: slices)
removeCharFromString('Bloop pow woot', 'o')  returns 'Blp pw wt'
removeCharFromString('ich bin ein holtzfaller', ' ') returns 'ichbineinholtzfaller'

2.removeFromString(s,part) accepts a string s, and a string to be removed from s called part. Return the string with all instances of that part removed. (Hint: do not try to use the previous solution)

removeFromString('aababa', 'aba')  returns 'aba'
removeFromString('Bloop pow woot', 'oo')  returns 'Blp pow wt'
removeFromString('Bloop woot pow woot', ' woot')  returns 'Bloop pow'
removeFromString('ich bin ein holtzfaller', 'n ') returns 'ich bieiholtzfaller'