For Programmers: Free Programming Magazines  


Home > Archive > PERL Programming > May 2006 > how to insert string in a string -> not tie









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author how to insert string in a string -> not tie
Jane

2006-05-11, 6:58 pm

I got the tie part, now how can i insert a string in a string?
for example, I have to add string in this string
<TR><TD>CFF</TD><TD>level 1</TD><!--INS1J--></TR>

add the string before my string marker <!--INS1J-->

so the final string may look like this
<TR><TD>CFF</TD><TD>level 1</TD>ADDSTRINGHERE<!--INS1J--></TR>

J

Gunnar Hjalmarsson

2006-05-11, 6:58 pm

Jane wrote:
> I got the tie part, now how can i insert a string in a string?
> for example, I have to add string in this string
> <TR><TD>CFF</TD><TD>level 1</TD><!--INS1J--></TR>
>
> add the string before my string marker <!--INS1J-->
>
> so the final string may look like this
> <TR><TD>CFF</TD><TD>level 1</TD>ADDSTRINGHERE<!--INS1J--></TR>


Use the s/// operator or combine the index() and substr() functions.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com