Get character from string Tagged: string This topic contains 3 replies, has 3 voices, and was last updated by Tony Antony 4 months, 1 week ago. Author Posts January 17, 2017 at 7:18 pm #62050 Tony AntonyParticipant 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. Thanks? Tony January 17, 2017 at 7:37 pm #62052 random commandlineParticipant $string = '[MembersOf-1]' $string -match '-(\d+)' | Out-Null ; $Matches January 17, 2017 at 7:43 pm #62053 Paul FrankovichParticipant $String -Replace '\D+' January 17, 2017 at 8:40 pm #62055 Tony AntonyParticipant Thank you all Author Posts You must be logged in to reply to this topic.