CODEKILLER

반응형

Trim, TrimStart, TrimEnd
Trim, TrimStart, TrimEnd

public class Example
{
    public static void Main()
    {
        string source = "    I am stronger than Batman.      ";
        var txtTrim = source.Trim();
        var txtTrimStart = source.TrimStart();
        var txtTrimEnd = source.TrimEnd();
        Console.WriteLine($"<{source}>");
        Console.WriteLine($"<{txtTrim}>");
        Console.WriteLine($"<{txtTrimStart}>");
        Console.WriteLine($"<{txtTrimEnd}>");
    }
}
반응형

공유하기

facebook twitter kakaoTalk kakaostory naver band