Problem 2073. Split a given string from the first instance of a given character
A simple operation to split a given string into two substrings at the point where the desired character is first found. e.g.
inputString: 'we have 6 cars' split it from '6'
output: 'we have ' and '6 cars'
If the desired character is not found then first substring is same as the whole string and the second string is empty string, i.e. y2='';
Solution Stats
Problem Comments
-
3 Comments
how about adding some test cases with multiple occurances of the divider?
Thanks, good idea
Additional test cases have been added.
Solution Comments
Show commentsProblem Recent Solvers101
Suggested Problems
-
Reverse the Words (not letters) of a String
432 Solvers
-
Given a window, how many subsets of a vector sum positive
846 Solvers
-
Is the paranthesis sequence balanced ?
157 Solvers
-
280 Solvers
-
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
366 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!