Quantcast
Channel: How to replace special characters to underscore(_) perl - Stack Overflow
Viewing all articles
Browse latest Browse all 2

How to replace special characters to underscore(_) perl

$
0
0
my @folder = ('s,c%','c__pp_p','Monday_øå_Tuesday,  Wednesday','Monday &       Tuesday','Monday_Tuesday___Wednesday');if ($folder =~ s/[^\w_*\-]/_/g ) {  $folder =~ s/_+/_/g;  print "$folder : Got %\n" ; }

Using above code i am not able to handle this "Monday_øå_Tuesday_Wednesday"

The output should be :

s_cc_pp_pMonday_øå_Tuesday_WednesdayMonday_TuesdayMonday_Tuesday_Wednesday

Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images