C# Trim string regardless of characters

后端 未结 4 667
无人及你
无人及你 2021-01-24 21:47

So here the situation.

I have multiple strings that begin and end with a random amount of spaces. The problem is the string contains multiple words so I can\'t just rep

4条回答
  •  梦谈多话
    2021-01-24 22:23

    What about String.Trim()?

    http://msdn.microsoft.com/en-us/library/system.string.trim.aspx

    Returns a new string in which all leading and trailing occurrences of a set of specified characters from the current String object are removed.

提交回复
热议问题