Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PERL] problem with replacing word

Status
Not open for further replies.

maulin sheth

Advanced Member level 2
Joined
Oct 24, 2010
Messages
502
Helped
90
Reputation
179
Reaction score
90
Trophy points
1,318
Location
Bangalore, India
Activity points
4,161
Hello All,
I want to insert the new line character i.e. \n in place of space i.e. \s;
E.G.
Mauiln Sheth DFT Engineer
I want to replace all spaces with new line character.

I have done
$string =~ s/\s/\n/;

the output is :

Maulin
Sheth DFT Engineer.

So why other spaces are not replaced by \n?

What I am missing?What I have to do to achieve that?

Thanks & Regards,
 

Try this one:
$string =~ s/\s/\n/g;
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top