프로그래밍

C# paiza 68 - String 클래스 가진 메소드 사용

노마드선샤인 2020. 5. 17. 22:04
728x90

// Stringクラスの持つメソッドを使ってみよう

 

using System;

 

public class Practice

{

    public static void Main()

    {

        var str = "The apple never falls far from the tree.";

 

        // それぞれのメソッドの結果を1行ずつ出力する

Console.WriteLine(str.ToUpper());

Console.WriteLine(str.Substring(4)); //0부터 시작해서 4번째 문자부터 출력

Console.WriteLine(str.IndexOf("apple"));

 

    }

}

///////////////

728x90