[scilab-Users] How to address part of a string

Mathieu Dubois mathieu.dubois at limsi.fr
Mon Sep 26 20:24:01 CEST 2011


On 09/26/2011 08:12 PM, Jerry Wang wrote:
> Hello,
> I'm new to scilab, so please excuse the simple question.  (I had 
> searched a few hours and can't find answer)
> How do I address part of a string?
> For example:
> myString = "abcdefg"
> How do I get characters 4:6, which would be"def"?
Use the part function.

BTW one of the best feature of scilab (compared to matlab) is it's 
ability to have matrices of strings (with different sizes) because a 
string is an object.
When doing myString = "abcdefg" you are creating a 1x1 matrix (similarly 
a=2.3 is matrix).
You can see that by typing myString(1).
> Thank you.
> Jerry

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20110926/0e727a93/attachment.htm>


More information about the users mailing list