I have a string representation exactly like ‘ComputerName — IPAddress’; i.e:
‘samarena — 192.168.1.97’
. I want to get only the ‘ComputerName’ part from the actual representation by removing other characters. I’m actually quite beginner in using string.FormatMethods() .
Please help me out.
Thanks.
This should do it:
Result will equal
samarena