Jun 23, 2010 #1 mikawin Technical User Apr 15, 2009 28 US I want to replace characters in specified positions for a series of strings. An arbitrary example: String Input: XXXyRRRtF8 Replace 4th & 8th characters 'y' and 't' with '1' & '2' respectively to give the output: XXX1RRR2F8 Thanks for your help! ~Mika
I want to replace characters in specified positions for a series of strings. An arbitrary example: String Input: XXXyRRRtF8 Replace 4th & 8th characters 'y' and 't' with '1' & '2' respectively to give the output: XXX1RRR2F8 Thanks for your help! ~Mika
Jun 23, 2010 1 #2 rharsh Technical User Apr 2, 2004 960 US One way: Code: $_ = 'XXXyRRRtF8'; substr($_,3,1,1); substr($_,7,1,2); print; Which prints: XXX1RRR2F8 Upvote 0 Downvote
One way: Code: $_ = 'XXXyRRRtF8'; substr($_,3,1,1); substr($_,7,1,2); print; Which prints: XXX1RRR2F8