135

I got a laugh out of this one this morning.

enter image description here

The problem is the truncation of the word "mentions" into "men." Hovering shows the full text.

The fix is truncate on word boundaries. And curiously, about this case, the truncation isn't even needed at that spot.

34
  • 9
  • 5
    Truncated text length = 80. May be useless fact. May be useful information to someone
    – Tim
    Commented May 17, 2016 at 13:14
  • 59
    Love your edit on my title Commented May 17, 2016 at 13:18
  • 31
    You got a laugh? Well I got triggered.
    – BoltClock Mod
    Commented May 17, 2016 at 13:44
  • 95
    We should improve this, as removing the end of a sentence is high-value information. Instead, we should remove characters from the middle of the sentence in a uniform manner, thus spreading out the loss of information over less critical parts of the sentence. Commented May 17, 2016 at 14:10
  • 3
    In case they have any problems implementing this: Truncate string on whole words in .NET C# Commented May 17, 2016 at 17:17
  • 9
    @Yakk Well "Users with shorts can't be pinged by men" is a grammatically correct sentence, it just doesn't mean what the original title meant (and really I was just joking about the funny possibilities of that kind of algorithm)
    – Kevin
    Commented May 17, 2016 at 17:39
  • 9
    @Yakk seems the obvious solution would be to auto-txt-spk: "usrs w sht names (2chars w/o space) Cnot b pinged by mentN n cht lol". I'm led to believe from "dem yooth" that it's still perfectly readable with zero information loss.
    – Dave
    Commented May 17, 2016 at 17:49
  • 5
    @Dave I think dem yooth would want some emojis in there. Commented May 17, 2016 at 19:38
  • 4
    Should we move this question to meta.meta.stackoverflow.com? Commented May 17, 2016 at 19:45
  • 3
    @PaulCezanne It would be turtles all the way up...
    – Laurel
    Commented May 17, 2016 at 20:59
  • 38
    Current title of THIS meta post is also truncated at a funny point... :D
    – anishsane
    Commented May 18, 2016 at 4:50
  • 7
    @BoltClock: Your comment should be flagged and deleted. *ducks* Commented May 18, 2016 at 11:49
  • 4
    ... Which goes against the OP's apparent intentions, @bjb568. I don't want to get involved in that edit war, but I'm very tempted to roll it back to the OP's original revision.
    – Cerbrus
    Commented May 19, 2016 at 13:34
  • 5
    Correction: "This is meta, we hate fun". The title was clever, and clear enough once you take a quick look at the question.
    – Cerbrus
    Commented May 19, 2016 at 13:41

2 Answers 2

18

I just modified the truncation function used so that if a word gets cut in half, it is removed from the result. So in the case in point the result would be Users with short names (2 characters excluding spaces) can not be pinged by...

4

A simple possible solution is to truncate to full words.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .