首字母缩写

首字母缩写

把一个长短语转换成它的首字母缩写。
深入探索首字母缩写!

我们会循序渐进地探索正则表达式:从最基本的空白匹配开始,再到探索 Unicode,最后以否定后行断言收尾。最后,我们还会看看解决首字母缩写的其他思路,包括状态机。

说明

Convert a phrase to its acronym.

Techies love their TLA (Three Letter Acronyms)!

Help generate some jargon by writing a program that converts a long name like Portable Network Graphics to its acronym (PNG).

Punctuation is handled as follows: hyphens are word separators (like whitespace); all other punctuation can be removed from the input.

For example:

Input Output
As Soon As Possible ASAP
Liquid-crystal display LCD
Thank George It's Friday! TGIF

来源

Julien Vanier链接会在新窗口或新标签页中打开