다음을 통해 공유


FixedLengthString.ToString 메서드

정의

FixedLengthStringString로 변환합니다.

public:
 override System::String ^ ToString();
public override string ToString();
override this.ToString : unit -> string
Public Overrides Function ToString () As String

반환

의 값을 FixedLengthString포함하는 A String 입니다.

예제

다음 예제에서는 선언 하 고 사용 하는 방법을 보여 줍니다 FixedLengthString.

Private Sub DemoFixedLengthString()
    ' Declare a string that has a length of 7 characters and assign the
    ' initial string. The additional 5 positions will be padded with
    ' spaces.
    Dim fixedString As New FixedLengthString(7, "He")
    ' Display the string in a message box.
    MsgBox(fixedString.ToString)
    ' Assign a new value to the string.
    fixedString.Value = "Hello World"
    ' Display again. Note that only the first 7 characters are shown.
    MsgBox(fixedString.ToString)
End Sub

설명

이 클래스를 FixedLengthString 사용하여 Visual Basic 6.0 문자열의 동작을 에뮬레이트할 수 있으며, 이를 통해 고정 길이로 문자열을 선언할 수 있습니다. A FixedLengthString 를 변환할 수 없습니다. String속성을 참조 Value 하거나 메서드를 ToString 호출하여 형식을 변환해야 합니다.

메모

네임스페이 Microsoft.VisualBasic.Compatibility.VB6 스의 함수 및 개체는 Visual Basic 6.0에서 Visual Basic 2008로 업그레이드하기 위한 도구에서 사용할 수 있도록 제공됩니다. 대부분의 경우 이러한 함수와 개체는 .NET Framework의 다른 네임스페이스에서 찾을 수 있는 기능을 복제합니다. Visual Basic 6.0 코드 모델이 .NET Framework 구현과 크게 다른 경우에만 필요합니다.

적용 대상