Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: In search of a better way to trim string length

by kiat (Vicar)
on Jul 19, 2004 at 13:31 UTC ( #375544=note: print w/replies, xml ) Need Help??


in reply to Re^2: In search of a better way to trim string length
in thread In search of a better way to trim string

Hm...yours doesn't produce the desired outputs.

Given the following inputs:

1) "thisisthelongesttopicthatwilleverbepostedinperlmonks"

2) "this is the longest topic that will ever be posted in perlmonks"

Desired outputs:

1a) thisisthelongesttopicthatwille ...

2a) this is the longest topic ...

Yours gave the following outputs:

1a) thisisthelongesttopicthatwille...
verbepostedinperlmonks

2a) this is the longest topic that will ever be posted in perlmonks

Did I miss something?

  • Comment on Re^3: In search of a better way to trim string length

Replies are listed 'Best First'.
Re^4: In search of a better way to trim string length
by Vennis (Pilgrim) on Jul 19, 2004 at 14:26 UTC
    Nope, you missed nothing, i missed something :-) Never mind that code then, i'll leave it in case somebody finds it either useful or inspiring.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://375544]
help
Chatterbox?
[LanX]: fun, last time I was in Britain people had problems with my name, just rarely they said "like the children TV star Rolf Harris?", this time most replied instantly "Rolf? like the pedophile Rolf Harris" ?
LanX is perlophile
[ambrus]: Corion: read https://metacpan. org/pod/release/ MLEHMANN/AnyEvent- 7.13/lib/AnyEvent. pm#SUPPLYING-YOUR- OWN-EVENT-MODEL- INTERFACE in that case

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2016-12-08 12:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (140 votes). Check out past polls.