desiredforsome
asked on
Remove substring .net
I have a ssh tunnel that send the following command
"netstat -ntl |grep 4400"
It returns it to a string, here is my issue
I am doing this to check for open ports on remote ends, I need the string that comes back to not have the "netstat -ntl |grep 4400" in it.
I just need it to remove that 1 command from the string but display all other information.
Thank You In Advanced.
Writing in VS 2010 c#, VB
"netstat -ntl |grep 4400"
It returns it to a string, here is my issue
I am doing this to check for open ports on remote ends, I need the string that comes back to not have the "netstat -ntl |grep 4400" in it.
I just need it to remove that 1 command from the string but display all other information.
Thank You In Advanced.
Writing in VS 2010 c#, VB
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
let's say that you're checking other ports too:
"netstat -ntl |grep 4400"
"netstat -ntl |grep 900"
"netstat -ntl |grep 80"
...
and that you have a string called "returnString" that is returning something like:
"netstat -ntl |grep 4400 Bla, Bla, Bla A..."
"netstat -ntl |grep 900 Bla, Bla, Bla B..."
"netstat -ntl |grep 80 Bla, Bla, Bla C..."
you could do something like (VB):
returnString = returnString.Replace("nets
returnString = returnString.Substring(InS
this will return:
"Bla, Bla, Bla A..."
"Bla, Bla, Bla B..."
"Bla, Bla, Bla C..."