Problem 31. Remove all the words that end with "ain"
Given the string s1, return the string s2 with the target characters removed.
For example, given
s1 = 'the main event'
your code would return
s2 = 'the event'
Note the 2 spaces between "main" and "event" Only the four letters in the word "main" were deleted.
Solution Stats
Problem Comments
-
6 Comments
I agree... This problem improved my knowledge of regexp. Although my code is running well in my computer but not here. I'm using R2015a. Can anyone please help ! Thank you
Did it in two steps, so many functionality in regexp that I discovered for myself today.. )
nice problem..really nic
Solution Comments
Show commentsProblem Recent Solvers2418
Suggested Problems
-
Remove the small words from a list of words.
1527 Solvers
-
Increment a number, given its digits
660 Solvers
-
Piecewise linear interpolation
560 Solvers
-
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
382 Solvers
-
Find the sides of an isosceles triangle when given its area and height from its base to apex
1976 Solvers
More from this Author96
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!