Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Splitting on non-initial uppercase without split

by si_lence (Deacon)
on Jan 26, 2005 at 10:22 UTC ( #425161=note: print w/replies, xml ) Need Help??


in reply to Splitting on non-initial uppercase without split

Hi
If I get you right you want to have a blank before each
capital letter except the first one in the string. Right?
If yes use
$s =~ s/.(?=[A-Z])/ /g;

si_lence
update:
The comment of edan is right (sorry to mess it up)
but this should work
$s =~ s/(.)(?=[A-Z])/$1 /g;

si_lence

Replies are listed 'Best First'.
Re^2: Splitting on non-initial uppercase without split
by edan (Curate) on Jan 26, 2005 at 10:43 UTC

    Erm, no. That's going to turn "LikeThis" into "Lik This"

    --
    edan

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://425161]
help
Chatterbox?
[Corion]: Hi choroba! Yeah, I brought the rain with me from Hamburg
[Corion]: marto: As am I ;) And we got two interested locations for next year, Munich and Cologne maybe, which is great as well. Not Berlin though ;)
[marto]: damn
[choroba]: Munich is kind of close from here
[Corion]: marto: Maybe in three years it'll be Berlin again ;)
[marto]: in 3 years I may be able to go :P
[Corion]: choroba: Both teams will ponder on whether/where/how to organize things. The workshop will be mainly in German though

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2017-06-29 08:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (655 votes). Check out past polls.