$text=’here is some text with Uppercase letters’
$text=’here is some text with Uppercase letters’
$c=0
$position=foreach ($character in $text.ToCharArray())
{
$c++
if ([Char]::IsUpper($character))
{
$c
break
}
}
if ($position -eq $null)
{
‘No uppercase characters detected.’
}
else
{
“First uppercase character at position $position”
$text.Substring(0, $position) + “<<<” + $text.Substring($position)
}
© 版权声明
文章版权归作者所有,未经允许请勿转载。