Javatpoint Logo
Javatpoint Logo

C# String Trim()

The C# Trim() method is used to remove all leading and trailing white-space characters from the current String object.

Signature

Parameter

First method does not take any parameter. Second method takes a char array as parameter.

Return

It returns a string.


C# String Trim() Method Example

Output:

Hello C#





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA