How to split a String ?

9 views (last 30 days)
Hi ,
I have a string 2-1 . I want to split this into Two different strings 2 and 1.
Can someone please throw some light on how to use the split string function.
Thanks in Advance.
  2 Comments
sujayandra vaddagiri
sujayandra vaddagiri on 19 Jun 2013
oops..... just got it
s2 = regexp(string, '-', 'split')
the cyclist
the cyclist on 19 Jun 2013
You should put this comment as an answer below, and then accept that answer. That will help people looking for similar solutions later.

Sign in to comment.

Accepted Answer

sujayandra vaddagiri
sujayandra vaddagiri on 26 May 2014
s2 = regexp(string, '-', 'split')

More Answers (0)

Categories

Find more on Characters and Strings in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!