Convert-StringConvert-String

Convert-String 公开“魔法替换”功能。Convert-String exposes "replace by magic" functionality. 提供所需文本外观的前后对照示例,Convert-String 将自动设置文本格式。Provide before and after examples of how you want text to look, and Convert-String formats your text automatically. 以下是一个演示:取某人的名字和姓氏,并替换为其姓氏、逗号、姓氏(拼音)首字母和句点。Here's a demo - taking somebody's first and last name, and replacing it with their last name, a comma, the first initial of their last name, and a dot. 使用正则表达式进行尝试,并查看所用时间。Try it with a regex, and see how long it takes you.

"Lee Holmes", "Steve Lee", "Jeffrey Snover" | Convert-String -Example "Bill Gates=Gates, B.","John Smith=Smith, J."

Holmes, L.
Lee, S.
Snover, J.