Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Sandbox

Comments on Abbreviate everything [released]

Post

Abbreviate everything [released]

+1
−0

Challenge

Make a program that takes input of a string and abbreviate it.

  • All letters of an abbreviation are capitalized, so keep that in mind.
  • Whitespace, numbers and non-English characters are ignored.
  • If the inputted string is a paragraph (2+ sentences), the abbreviation will be split by spaces ( ) where ., ? or ! are, while commas (,) are ignored in this splitting scenario.
  • Words that are connected by hyphens (-) will result to only one letter.
  • The only non-alphabetical characters to remain in the result are colons (:) and semicolons (;).
  • This is code-golf, so shortest program in each language wins.

Test Cases

// Input
# Output

Hello, World!
HW

Can you make me a sandwich?
CYMMAS

hyper-neutrino
H

Too long; didn't read
TL;DR

I studied, don't worry. I will pass.
ISDW IWP

What???!?!
W

Get me 99 bottles of beer, bro!
GMBOBB
History
Why does this post require moderator attention?
You might want to add some details to your flag.

2 comment threads

What should we use for splitting? (2 comments)
What should be done with numbers in the input? (2 comments)
What should we use for splitting?
Moshi‭ wrote over 2 years ago

If the inputted string is a paragraph (2+ sentences), the abbreviation will be split...

You don't specify what character to use to split the sentence, so can we use any character?

General Sebast1an‭ wrote over 2 years ago

Moshi‭ Spaces.