hi monks. so i have a simple i think question, but i cant find any easy or fast solution, so it is not so simple to me. :p Say, there is this scenario, where you have a variable which contains a string full of ones and zeroes like:
$string = "010011100001110110100110111000001";
What do you think would be the quickest, not only for the cpu but for writing too, way to create another string, with the number of continual zeroes in it. Let's say for the above $string, to create a new one with this format:
$string = "010011100001110110100110111000001"; $newString = "1, 2, 4, 1, 1, 2, 1, 5";
where 1 is for the first zero in $string, 2 for the 2 zeroes in third and fourth place, 4 for the 4 zeroes in 8th, 9th, 10th, and 11th place. etc... I m really sorry if you cant really make out what i mean, but english is not my native language. Any help would be appreciated.
In reply to string manipulation by kimlid2810
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |