At 10:04 pm +0200 18/8/03, Eelco Alosery wrote:
>I want to split a string into servral partsThe string starts whith
>## than the text and than again ## but the string lent is not a
>fixed sise.
>It can by:
>##text1##text2##text3##
>but also longer like:
>##text1##text2##text3##text4##text5##text6##text7##
>
>I want to split this string zo i can display the text each on a
>seperat line or eddit the text
Just use split:
#!/usr/bin/perl
$s = qq~##text1##text22##text333##text4444##text5555~;
@parts = split qq~##~, $s ;
for (@parts) {
print qq~$_$/~ if /./ ;
}
Thread Previous