Export (0) Print
Expand All

Strings Class

The Strings module contains procedures used to perform string operations.

System.Object
  Microsoft.VisualBasic.Strings

Namespace:  Microsoft.VisualBasic
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)

[StandardModuleAttribute]
public sealed class Strings

The Strings type exposes the following members.

  NameDescription
Public methodStatic memberAsc(Char)Returns an Integer value representing the character code corresponding to a character.
Public methodStatic memberAsc(String)Returns an Integer value representing the character code corresponding to a character.
Public methodStatic memberSupported in .NET for Windows Store appsAscW(Char)Returns an Integer value representing the character code corresponding to a character.
Public methodStatic memberSupported in .NET for Windows Store appsAscW(String)Returns an Integer value representing the character code corresponding to a character.
Public methodStatic memberChrReturns the character associated with the specified character code.
Public methodStatic memberSupported in .NET for Windows Store appsChrWReturns the character associated with the specified character code.
Public methodSupported in .NET for Windows Store appsEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodStatic memberFilter(Object[], String, Boolean, CompareMethod)Returns a zero-based array containing a subset of a String array based on specified filter criteria.
Public methodStatic memberFilter(String[], String, Boolean, CompareMethod)Returns a zero-based array containing a subset of a String array based on specified filter criteria.
Public methodStatic memberFormatReturns a string formatted according to instructions contained in a format String expression.
Public methodStatic memberFormatCurrencyReturns an expression formatted as a currency value using the currency symbol defined in the system control panel.
Public methodStatic memberFormatDateTimeReturns a string expression representing a date/time value.
Public methodStatic memberFormatNumberReturns an expression formatted as a number.
Public methodStatic memberFormatPercentReturns an expression formatted as a percentage (that is, multiplied by 100) with a trailing % character.
Public methodStatic memberGetCharReturns a Char value representing the character from the specified index in the supplied string.
Public methodSupported in .NET for Windows Store appsGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodSupported in .NET for Windows Store appsGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodStatic memberInStr(String, String, CompareMethod)Returns an integer specifying the start position of the first occurrence of one string within another.
Public methodStatic memberInStr(Int32, String, String, CompareMethod)Returns an integer specifying the start position of the first occurrence of one string within another.
Public methodStatic memberInStrRevReturns the position of the first occurrence of one string within another, starting from the right side of the string.
Public methodStatic memberJoin(Object[], String)Returns a string created by joining a number of substrings contained in an array.
Public methodStatic memberJoin(String[], String)Returns a string created by joining a number of substrings contained in an array.
Public methodStatic memberLCase(Char)Returns a string or character converted to lowercase.
Public methodStatic memberLCase(String)Returns a string or character converted to lowercase.
Public methodStatic memberLeftReturns a string containing a specified number of characters from the left side of a string.
Public methodStatic memberLen(Boolean)Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Public methodStatic memberLen(Byte)Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Public methodStatic memberLen(Char)Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Public methodStatic memberLen(DateTime)Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Public methodStatic memberLen(Decimal)Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Public methodStatic memberLen(Double)Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Public methodStatic memberLen(Int16)Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Public methodStatic memberLen(Int32)Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Public methodStatic memberLen(Int64)Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Public methodStatic memberLen(Object)Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Public methodStatic memberLen(SByte)Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Public methodStatic memberLen(Single)Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Public methodStatic memberLen(String)Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Public methodStatic memberLen(UInt16)Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Public methodStatic memberLen(UInt32)Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Public methodStatic memberLen(UInt64)Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.
Public methodStatic memberLSetReturns a left-aligned string containing the specified string adjusted to the specified length.
Public methodStatic memberLTrimReturns a string containing a copy of a specified string with no leading spaces (LTrim), no trailing spaces (RTrim), or no leading or trailing spaces (Trim).
Public methodStatic memberMid(String, Int32)Returns a string that contains all the characters starting from a specified position in a string.
Public methodStatic memberMid(String, Int32, Int32)Returns a string that contains a specified number of characters starting from a specified position in a string.
Public methodStatic memberReplaceReturns a string in which a specified substring has been replaced with another substring a specified number of times.
Public methodStatic memberRightReturns a string containing a specified number of characters from the right side of a string.
Public methodStatic memberRSetReturns a right-aligned string containing the specified string adjusted to the specified length.
Public methodStatic memberRTrimReturns a string containing a copy of a specified string with no leading spaces (LTrim), no trailing spaces (RTrim), or no leading or trailing spaces (Trim).
Public methodStatic memberSpaceReturns a string consisting of the specified number of spaces.
Public methodStatic memberSplitReturns a zero-based, one-dimensional array containing a specified number of substrings.
Public methodStatic memberStrCompReturns -1, 0, or 1, based on the result of a string comparison.
Public methodStatic memberStrConvReturns a string converted as specified.
Public methodStatic memberStrDup(Int32, Char)Returns a string or object consisting of the specified character repeated the specified number of times.
Public methodStatic memberStrDup(Int32, Object)Returns a string or object consisting of the specified character repeated the specified number of times.
Public methodStatic memberStrDup(Int32, String)Returns a string or object consisting of the specified character repeated the specified number of times.
Public methodStatic memberStrReverseReturns a string in which the character order of a specified string is reversed.
Public methodSupported in .NET for Windows Store appsToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodStatic memberTrimReturns a string containing a copy of a specified string with no leading spaces (LTrim), no trailing spaces (RTrim), or no leading or trailing spaces (Trim).
Public methodStatic memberUCase(Char)Returns a string or character containing the specified string converted to uppercase.
Public methodStatic memberUCase(String)Returns a string or character containing the specified string converted to uppercase.
Top

This module supports the Visual Basic language keywords and run-time library members that manipulate strings.

The following example demonstrates how to split a string at its spaces.

Dim TestString As String = "Look at these!" 
' Returns an array containing "Look", "at", and "these!". 
Dim TestArray() As String = Split(TestString)

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone 8.1

Windows Phone 8.1, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft