Php-like explode and replace?
Author |
Message |
AzureFire
|
Posted: Sat Jan 28, 2006 12:53 pm Post subject: Php-like explode and replace? |
|
|
I was wondering if there was a command in Turing that would seperate a string into an array at a certain characher
eg. code: | In php
$pizza = "piece1|piece2|piece3|piece4|piece5|piece6";
$pieces = explode("|", $pizza);
echo $pieces[0]; // piece1
echo $pieces[1]; // piece2
|
as well is there a way to replace letters/numbers/symbols in a string with another letters/numbers/symbol?
Thanks! |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Delos
|
Posted: Sat Jan 28, 2006 2:14 pm Post subject: (No subject) |
|
|
Don't know anything about PHP, but with Turing I'd imagine you'd use a series of index()'s in some nifty functions.
In other words, yes these do exist, but only after you've made them . |
|
|
|
|
|
Tony
|
Posted: Sat Jan 28, 2006 5:21 pm Post subject: (No subject) |
|
|
the functions are not pre-made for you, but index() will tell you where the first instance of a substring occurs. You could loop over that to do both desired actions. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
AzureFire
|
Posted: Sat Jan 28, 2006 5:27 pm Post subject: (No subject) |
|
|
ok thanks, I'll look into it a little more. |
|
|
|
|
|
|
|