728x90
SMALL

// splitで文字列を分割してみよう

using System;

using System.Collections.Generic;

public class Hello{

    public static void Main(){

        var data = Console.ReadLine();

        Console.WriteLine(data);

        // 勇者,,魔法使い,忍者를 입력 란에 입력하기 

        string[] array = data.Split(','); // 쉼표(,)를 기준으로 배열에 있는 데이터를 자른다. 

        foreach(var str in array)

        {

            Console.WriteLine(str);

            //,를 통해 잘려서 나온다. 용자, 전사, 마법사용, 닌자

        }

    }

}

////////

//

//

// 文字列をカンマで分割する

using System;

using System.Collections.Generic;

public class Program{

    public static void Main(){

        var team = "勇者,,忍者,魔法使い"; // 위에 거는 입력하는 거고 여기는 배열이 저장된 상태

        // ここに文字列を分割するコドを記述する

        string[] array = team.Split(',');

        foreach (var str in array)

        {

            Console.WriteLine(str);

        }

    }

}

// 문자열을 컴마로 분할

//

// 英文のえる

using System;

using System.Collections.Generic;

public class Program{

    public static void Main(){

        string str = "One cold rainy day when my father was a little boy he met an old alley cat on his street";

        // ここに文字列を分割するコドを記述する

        string[] array = str.Split(' '); //스페이스를 기준으로 분할

        int count = array.Length;

       

        Console.WriteLine(count);

    }

}

 

//영어 문장을 단어 수로 나눈다. 스페이스를 이용해서

//

// 標準入力からんだURLを分割する

// https://paiza.jp/cgc/users/ready

using System;

using System.Collections.Generic;

public class Hello{

    public static void Main(){

        var url_str = Console.ReadLine(); //입력 란에 저 주석이 있는 주소를 입력한다.

        // ここに文字列を分割するコドを記述する

        string[] url = url_str.Split('/'); // 인터넷 주소를 /로 분할하고

       

        foreach (var s in url)

        {

            Console.WriteLine(s); // 이러한 내용을 출력한다.

        }

    }

}

///////////

 

 

728x90

설정

트랙백

댓글