9일차 메서드의 정의(5) 문자열 1개를 받아 길이를 반환
Console Programming/C# Console 2019. 10. 3. 13:33문자열 1개를 매개변수로 받아 문자열의 길이를 반환하는 메서드를 정의 하고 호출 하세요
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
using System;
using Syntax24;
namespace Syntax24
{
class App
{
public App()
{
Console.WriteLine("2019-09-30");
Console.WriteLine();
Console.WriteLine(GetLenghtFromString("홍길동"));
}
public int GetLenghtFromString(string str)
{
return str.Length;
}
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
|
'Console Programming > C# Console' 카테고리의 다른 글
9일차 메서드의 정의(11) 정수의 크기비교 (0) | 2019.10.03 |
---|---|
9일차 메서드의 정의(10) 정수1개를 받아 별을 출력 (0) | 2019.10.03 |
9일차 메서드의 정의(4) 문자1개를 받아 아스키 코드로 출력 (0) | 2019.10.03 |
9일차 메서드의 정의(3) 짝수이면 True를 반환 (0) | 2019.10.03 |
백준 11720 숫자의 합 (0) | 2019.10.01 |