Or, using pos() and \G
$ perl -le' $_ = q/atcgcgtacatcgatac/; print; pos = 8; s/\G(.)/\u$1/; print; ' atcgcgtacatcgatac atcgcgtaCatcgatac
In reply to Re^2: String character replacement based on position
by deibyz
in thread String character replacement based on position
by shu_uemura
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |