[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: Tokenizer
From: Thomas <zander () xs4all ! nl>
Date: 2001-01-10 8:44:43
[Download RAW message or body]
> Examples from the docs:
>
> perlSplit("__", "some__string__for__you__here", 3)
> -> "some", "string", "for", "you__here"
>
> perlSplit(' ', "kparts reaches the parts other parts can't", 2)
> -> "kparts", "reaches", "the parts other parts can't"
>
> perlSplit(QRegExp("[! ]"), "Split me up ! I'm bored ! OK ?", 2)
> -> "Split", "me", "up ! I'm bored, OK ?"
>
If you call it perlsplit I would expect the same behaviour as in perl, you
limit it with the numeral 3 and get 4 parts, I think that is odd. Perl
splits into the number of parts you enter.
{$first,$last} = split ( / /, "First words matter", 2);
--
Thomas Zander zander@earthling.net
The only thing worse than failure is the fear of trying something new
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic