powershell check if last character is code example
Example 1: powershell check end of string
#Program to check if string "check" comes at the begining of the string
$str="checking1234"
if ( $str.startswith("check") )
{
echo "String $str starts with check"
}
Example 2: powershell check end of string
#Program to check if string "ing" exists in the string
$str="checking1234"
if ( $str.contains("ing") )
{
echo "String $str contains - [ing]"
}