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
Marcel
on 6 Jan 2014
how about adding some test cases with multiple occurances of the divider?
Mehmet E. Yavuz
on 7 Jan 2014
Thanks, good idea
goc3
on 31 May 2017
Additional test cases have been added.
Solution Comments
Show commentsGroup

Strings II
- 21 Problems
- 41 Finishers
- Eliminate Polysyllabics: Long live short words!
- Alternately upper-lower case
- Morse Code Generator! Try it!
- Is the paranthesis sequence balanced ?
- Simple Decoder Ring
- Join Strings with Multiple Different Delimiters
- Is the paranthesis sequence balanced ?
- Count letters occurence in text, specific to words with a given length.
- Convert Two Character String into a Binary Vector
- Kryptos - CIA Cypher Sculpture: Vigenere Encryption
- Kryptos - CIA Cypher Sculpture: Vignere Decryption
- Mean and standard deviation of times in string
- How many digits are there?
- ABBREVIATION
- Make a list string
- Generate a melodic contour string matrix
- Morse Code Generator! Try it!
- NO _________ ALLOWED....
- Backslang, odds are you used it at some point in time...
- Simple Caesar Cypher - shift encrypt a message given an index number
- Split a given string from the first instance of a given character
- Concatenate strings
- most frequent character
- Alternately upper-lower case
Problem Recent Solvers109
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!