[Scilab-Dev] SEP 26 : strsplit(), add the capability to split a string on a pattern.

Pierre MARECHAL pierre.marechal at scilab.org
Wed May 6 11:22:24 CEST 2009


Sylvestre Ledru a écrit :
>> Please find attached SEP #26 (V1.0) about strsplit(). This SEP
>> proposes to add the capability to split a string on a single
>> character, a group of characters or a regular expression (a pattern).
>>
>> As usual, please comment it as needed. 
>>     
> I don't know if it is normal but I get a blank #3 page?
>   
No, Fixed with the attached file.
> Two points:
> * if str is a matrix of string, will pattern be only one string applied
> to all the strings in the matrix ?
>   
"str" cannot be a matrix of string because strsplit() returns a matrix 
of string from a "single string".

> * could you add an example with "limit" ?
>   

To split off the first four fields from a line from /etc/passwd:

-->strsplit(password_line,":",5)

ans =
! root                 !
! x                    !
! 0                    !
! 0                    !
! root:/root:/bin/bash !
> Sylvestre
>   
Pierre

-- 
==============================================
Pierre MARECHAL
                   ------
Fondation DIGITEO - Consortium Scilab
Domaine de Voluceau - B.P. 105
78153 Le Chesnay Cedex
Bâtiment 23 - Bureau 24
                   ------                  
Email : pierre.marechal at scilab.org
Tél : +33 (0)1 39 63 56 81
Fax : +33 (0)1 39 63 55 94
==============================================

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/dev/attachments/20090506/7ca1158d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SEP_26_extends_strsplit.pdf
Type: application/pdf
Size: 473319 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/dev/attachments/20090506/7ca1158d/attachment.pdf>


More information about the dev mailing list