I am having trouble cutting down my string. I have a windows form application that receives incoming data. So far the examples I have found all use char to locate. I need to have it search for the entire "*S"
and not just one character of it.
I did find a way to get the index of the sting and trim from that point to the end (sting.remove).
My problem is i need to trim the beginning. so a trim to index method would work but I haven't found how to do that.
What i have is a bunch of data like
"ok \r\n *S 38773 get 3042"
What I need to do is locate the *S and remove everything from the beginning to the *S
. Because the return is not always the same I cant use replace or remove methods. I cant predict what will come before the *S and the remaining data is dynamic.
Any examples on how to essentially trim start to the "*S" would be wonderful. Thank you.
s = s.Substring(s.IndexOf("*S"));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With