Convert number to string with certain number of decimals
[double]$pi = 22/7 $pi.ToString('0.00')
String to uppercase on first letter only
$string.Substring(0,1).ToUpper() + $string.Substring(1,$string.Length-1).ToLower()
Find none ASCII characters
$string = "In mathematics, summation (capital Greek sigma symbol: ∑) is the addition of a sequence of numbers." $string.ToCharArray() | ForEach-Object{ $char = $_ try{$ascii = [byte][char]$char} catch{"$char - None ascii character" } }
Find characters between Greater Than and Less Than signs
$string = "LastName, ([samaccountname])" [Regex]::Matches($string, '(?
Find characters between Brackets []
$string = "LastName, FirstName ([samaccountname])" [Regex]::Matches($string, '(?
Find characters between Parentheses ()
$string = "LastName, FirstName ([samaccountname])" [Regex]::Matches($string, '(?
Combine an array into a string with semicolon separator
$array = 'The','quick','brown','fox','jumps','over','the','lazy','dog.' $array -join(';')