c# trim string based on character code example Example: c# trim string string hello = " hello world "; hello.Trim();