how to use trim in c# string code example Example: c# trim string string hello = " hello world "; hello.Trim();