다음을 통해 공유


StringBuilder.Chars 속성

이 인스턴트에서 특정 위치에 있는 문자를 가져오거나 설정합니다.

네임스페이스: System.Text
어셈블리: mscorlib(mscorlib.dll)

구문

‘선언
Public Default Property Chars ( _
    index As Integer _
) As Char
‘사용 방법
Dim instance As StringBuilder
Dim index As Integer
Dim value As Char

value = instance(index)

instance(index) = value
public char this [
    int index
] { get; set; }
public:
property wchar_t default [int] {
    wchar_t get (int index);
    void set (int index, wchar_t value);
}
/** @property */
public char get_Chars (int index)

/** @property */
public void set_Chars (int index, char value)
JScript에서는 인덱싱된 속성을 사용할 수 있지만 새로 선언할 수는 없습니다.

매개 변수

  • index
    문자의 위치입니다.

속성 값

index 위치에 있는 유니코드 문자입니다.

예외

예외 형식 조건

ArgumentOutOfRangeException

문자를 설정할 때 index가 이 인스턴스의 경계를 벗어나는 경우

IndexOutOfRangeException

문자를 가져올 때 index가 이 인스턴스의 경계를 벗어나는 경우

설명

index 매개 변수는 StringBuilder 내에 있는 문자의 위치입니다. 문자열의 첫 문자는 0 인덱스에 있습니다. 문자열의 길이는 해당 문자열에 포함된 문자 수입니다. 마지막으로 액세스할 수 있는 StringBuilder 인스턴스의 문자는 Length 인덱스에서 1을 뺀 위치에 있는 문자입니다.

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

StringBuilder 클래스
StringBuilder 멤버
System.Text 네임스페이스
String