Welcome › Forums › General PowerShell Q&A › Get character from string
This topic contains 3 replies, has 3 voices, and was last updated by
I have a string [MembersOf-1]
How would I get 1? I know you can use trim("[MembersOf-"), but then it will leave me with 1]
I know i can use trim or replace, but how would I take care of it all once.
$string = '[MembersOf-1]'
$string -match '-(\d+)' | Out-Null ; $Matches
$String -Replace '\D+'
Thank you all
The topic ‘Get character from string’ is closed to new replies.