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 memberAscW(Char)Returns an Integer value representing the character code corresponding to a character.
Public methodStatic memberAscW(String)Returns an Integer value representing the character code corresponding to a character.
Public methodStatic memberChrWReturns the character associated with the specified character code.
Public methodEquals(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.
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
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 methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets 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 memberLenReturns 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).
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodStatic memberMid(String, Int32)Returns a string containing a specified number of characters from a string.
Public methodStatic memberMid(String, Int32, Int32)Returns a string containing a specified number of characters from 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 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 methodToStringReturns 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)


Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

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

Community Additions

ADD
Show:
© 2014 Microsoft