Strings.Right(String, Int32) 메서드
정의
문자열의 오른쪽에서 지정한 개수의 문자를 포함하는 문자열을 반환합니다.Returns a string containing a specified number of characters from the right side of a string.
public:
static System::String ^ Right(System::String ^ str, int Length);
public static string Right (string? str, int Length);
public static string Right (string str, int Length);
static member Right : string * int -> string
Public Function Right (str As String, Length As Integer) As String
매개 변수
- str
- String
필수 요소.Required. 가장 오른쪽의 문자를 반환하는 String
식입니다.String
expression from which the rightmost characters are returned.
- Length
- Int32
필수 요소.Required. Integer
Integer
. 반환할 문자의 수를 나타내는 숫자 식입니다.Numeric expression indicating how many characters to return. 이 인수가 0인 경우 길이가 0인 문자열("")이 반환됩니다.If 0, a zero-length string ("") is returned. 이 인수가 str
의 문자 수보다 크거나 같으면 전체 문자열이 반환됩니다.If greater than or equal to the number of characters in str
, the entire string is returned.
반환
문자열의 오른쪽에서 지정한 개수의 문자를 포함하는 문자열입니다.A string containing a specified number of characters from the right side of a string.
예외
Length
< 0.Length
< 0.
예제
이 예제에서는 함수를 사용 Right
하 여 지정 된의 부분 문자열을 반환 하는 방법을 보여 줍니다 String
.This example demonstrates the use of the Right
function to return a substring of a given String
. 속성이 있는 클래스에서는 함수를 Right
정규화 해야 할 수도 있습니다 Right
.In a class that has a Right
property, it may be necessary to fully qualify the Right
function.
Dim testString As String = "Hello World!"
' Returns "World!".
Dim subString As String = Right(testString, 6)
설명
의 문자 수를 확인 하려면 str
함수를 사용 Len
합니다.To determine the number of characters in str
, use the Len
function. Windows Form 또는 속성이 있는 다른 클래스에서 사용 하는 경우를 사용 하 여 Right
함수를 정규화 해야 합니다 Microsoft.VisualBasic.Strings.Right
.If used in a Windows Form, or any other class that has a Right
property, you must fully qualify the function with Microsoft.VisualBasic.Strings.Right
.
참고
RightB
이전 버전 Visual Basic의 함수는 문자열이 아닌 바이트 단위로 문자열을 반환 합니다.The RightB
function in earlier versions of Visual Basic returns a string in bytes, rather than characters. 더블 바이트 문자 집합 (DBCS) 애플리케이션의 문자열을 변환에 주로 사용 됩니다.It is used primarily for converting strings in double-byte character set (DBCS) applications. 현재 Visual Basic 문자열은 모두 유니코드로 되어 있으며 RightB
더 이상 지원 되지 않습니다.All current Visual Basic strings are in Unicode, and RightB
is no longer supported.