Calculates the position of a substring and returns its index value. Note that the first character in a string is position "0", the second is position "1", etc. If the substring is not found within the specified string, this method returns "-1".
$[ScriptVariable]::positionOf(String str)
str (String): the substring for which you want to calculate an index value.
The following example illustrates how to use the positionOf variable method to return a Device name from within a variable containing the Device's target name:
$recipientTargetName = "bsmith|Home Email"
$position = $recipientTargetName::positionOf("|")
$deviceName = $recipientTargetName::substring($position + 1)
print($deviceName)
Home Email