James Edward Gray II wrote:
> Then you didn't read the documentation I sent you the link for. ;)
>
> A negative index counts backwards from the end of the string.
i did read it. maybe i should have asked my question like this: "why is
the 3rd argument negative when you can simply say:
substr($
On Aug 19, 2004, at 11:55 AM, Christopher J. Bottaro wrote:
Gunnar Hjalmarsson wrote:
You can use substr() as an rvalue:
substr($str1, 4, 8 - length $str1, $str2);
or if the length of $str1 is given:
substr($str1, 4, -4, $str2);# probably fastest
i don't understand why the 3rd
Gunnar Hjalmarsson wrote:
> You can use substr() as an rvalue:
>
> substr($str1, 4, 8 - length $str1, $str2);
>
> or if the length of $str1 is given:
>
> substr($str1, 4, -4, $str2);# probably fastest
i don't understand why the 3rd argument is negative.
given $str1 = 'xxx
Christopher J. Bottaro wrote:
say i have two strings "" and "". i want to
replace characters 4-7 in the first string with the second string
with an emphasis on speed.
basically i want to do what can be done in c with the following:
char str1[13] = "";
char *str2 = "
On Aug 19, 2004, at 10:55 AM, James Edward Gray II wrote:
On Aug 19, 2004, at 10:55 AM, Christopher J. Bottaro wrote:
say i have two strings "" and "". i want to replace
characters 4-7 in the first string with the second string with an
emphasis
on speed.
perldoc -f substring
Egad,
On Aug 19, 2004, at 10:55 AM, Christopher J. Bottaro wrote:
say i have two strings "" and "". i want to replace
characters 4-7 in the first string with the second string with an
emphasis
on speed.
perldoc -f substring
Come back if you need a bigger hint. ;)
James
--
To unsubscrib
say i have two strings "" and "". i want to replace
characters 4-7 in the first string with the second string with an emphasis
on speed.
basically i want to do what can be done in c with the following:
char str1[13] = "";
char *str2 = "";
strncpy(str1+4, str2, 4);