Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: How to remove other language character from a string

by kcott (Abbot)
on Nov 26, 2012 at 08:29 UTC ( #1005588=note: print w/ replies, xml ) Need Help??


in reply to How to remove other language character from a string

You could use the transliteration operator (y/// or tr///) - see Quote-Like Operators.

$ perl -Mstrict -Mwarnings -E '
my $x = q{ครัวซองเเซนด์วิชไข่ดาว Croissant Egg Sandwich ครัวซองเเซนด์วิชไข่ดาว};
$x =~ y/ -~//cd;
say $x;
'
 Croissant Egg Sandwich 

-- Ken


Comment on Re: How to remove other language character from a string
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1005588]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2014-12-27 21:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls