Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks, I have an array and a string.
$string = "ASDFGHJ"; @array = ("|", "|", "|", "|", "", "|", "|");
What I want is to find which element of the array is "" and change the corresponding letter in the string to lowercase letter; In this case it would be "ASDFgHJ". I have a vague idea on how to do it but there must be a easy single loop solution. There can be more than one "" elements and all of the corresponding letters need to be changed. Thank for your help! Tom
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Array indexing and string manipulation
by tobyink (Canon) on Mar 26, 2012 at 16:21 UTC | |
|
Re: Array indexing and string manipulation
by davido (Cardinal) on Mar 26, 2012 at 16:48 UTC | |
|
Re: Array indexing and string manipulation
by Anonymous Monk on Mar 26, 2012 at 16:26 UTC | |
by tobyink (Canon) on Mar 26, 2012 at 16:33 UTC | |
by Anonymous Monk on Mar 26, 2012 at 16:34 UTC | |
by Anonymous Monk on Mar 27, 2012 at 10:37 UTC | |
|
Re: Array indexing and string manipulation
by ikegami (Patriarch) on Mar 26, 2012 at 17:21 UTC | |
|
Re: Array indexing and string manipulation
by JavaFan (Canon) on Mar 26, 2012 at 16:44 UTC | |
|
Re: Array indexing and string manipulation
by jwkrahn (Abbot) on Mar 26, 2012 at 21:45 UTC |