Removing spaces from the beginning and end of any string in C# is easy:
myString = myString.Trim();
Why are you using
strlen
in C#? Each string object has it's own Length property...
Did you mean to post this as a question, or as a comment on someone's answer to a question? I ask, because the first part doesn't appear to make a lot of sense! What are you actually trying to achieve?