in reply to Formatting quotes in a String
$string .= '"'; # or substr $string, length $string, 0, '"'; # or $string =~ s/$/"/;
If you only want to add it when needed, just count the double quotes first, and only add it when the number is odd:
$string .= '"' if ($string =~ tr/"//) % 2;
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Formatting quotes in a String
by pavan474 (Novice) on Dec 01, 2016 at 07:26 UTC | |
by Laurent_R (Canon) on Dec 01, 2016 at 10:13 UTC | |
by pavan474 (Novice) on Dec 02, 2016 at 12:07 UTC | |
by perldigious (Priest) on Dec 01, 2016 at 14:18 UTC |