Re: [PBML] splitting characters ?
- Gamaliel Lagman wrote:
>You can also get to individual characters in a string without creating
> On Thu, 24 Aug 2000, Nathan Rimmer wrote:
> #>But what I want to do is to split a single word into
> #>its individual characters and then process it.
> #>split "wibble" into "w" "i" "b" "b" "l" and "e"
> #>I'm struggling on what to split on - ie I cant use
> #>blank spaces or | as I have done for other splits.
> Still use the basic split.
> @array = split //, $string;
> Split it witout any characters in between the slashes "//" it should
> segregate the characters from the string.
an extra array with substr():
for ($idx = 0 ; $idx < length($string) ; $idx++)
$chr = substr($string,$idx,1);
# do something with $chr