PowerShell 技能连载 - 根据大写字符分割文本
要在一段文本的每个大写字符出分割这段文本,而不用提供一个大写字符的列表,请试试这个例子:
$text = 'MapNetworkDriveWithCredential'
[Char[]]$raw = foreach ($character in $text.ToCharArray())
{
if ([Char]::IsUpper($character))
{
' '
}
$character
}
$newtext = (-join $raw).Trim()
$newtext
PowerShell 技能连载 - 根据大写字符分割文本
http://blog.vichamp.com/2015/05/26/splitting-text-at-uppercase-letters/