using System;
namespace myCSharp1
{
class Program
{
static void Main(string[] args)
{
// string은 immutable 타입으로 string에 추가 문자열을 추가하면 배열을 재할당한다.
string s2 = "Hello";
char c = s2[0];
Console.WriteLine(c);
for (int i = 0; i < s2.Length; i++)
{
Console.WriteLine(s2[i]);
}
s2 += " World";
for(int i = 0; i < s2.Length; i++)
{
Console.WriteLine(s2[i]);
}
}
}
}
'PROGRAMMING LANGUAGE > C#' 카테고리의 다른 글
StringBuilder (0) | 2022.02.22 |
---|---|
인덱서 (0) | 2022.02.21 |
10진수, 2진수, 16진수로 변수에 값 할당하기 (0) | 2022.01.19 |
Console 기능 (0) | 2022.01.19 |
헬로우 월드 (0) | 2022.01.17 |