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

Jerry Wang jerrwang at yahoo.com
Mon Sep 26 21:46:29 CEST 2011


Thank you.  part function works.
 
Yes, I was frustrated with not being able to get parts of a string by addressing myString(4:6) and was looking around to find combinations of [] and ().  Thank you for clarifying.
 
Jerry
 
From: Mathieu Dubois <mathieu.dubois at limsi.fr>
To: users at lists.scilab.org
Sent: Monday, September 26, 2011 11:24 AM
Subject: Re: [scilab-Users] How to address part of a string


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/3ff0513c/attachment.htm>


More information about the users mailing list