substitution in perl

R

raj.somla

Hi,

I have a string in curly brackets {121,121,121,asa,afr,ssf}. I want
to remove the { and chage it to nothing.

How do I do it?
 
M

Mirco Wahab

Hi,

I have a string in curly brackets {121,121,121,asa,afr,ssf}. I want
to remove the { and chage it to nothing.

How do I do it?

Please post some Perl code where you tried that already.

You mean, you have a string like:

my $stuff = '{121,121,121,asa,afr,ssf}';

and you need to keep only the content between {...}?

You should apply a simple Regex

$stuff =~ s/[{}]//g;

or just a transliteraton,

$stuff =~ y/{}//d;

Regards

M.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top