System.String

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
namespace System
public sealed class String

The String class exposes members that perform various tasks on strings, such as concatenating, comparing, replacing, and copying. The members documented below are available in traditional Synergy and Synergy .NET; for details about additional methods available in .NET, see the .NET Framework documentation.

To initialize a new instance of String, use the syntax

string_var = "text"

All string comparison routines are case sensitive.

Properties

String.Length

public Length

Returns the number of characters in the string. (int)

Methods

String.Clone

public Clone()

Returns a reference to this instance of String.

String.Concat

public static Concat(string1, string2), string

Concatenates string1 and string2 and returns the resulting string.

String.Contains

public Contains(substring), boolean

Looks for a substring within a string. Returns true if substring occurs within the instance string (or if substring is an empty string); otherwise returns false.

String.EndsWith

public EndsWith(string), boolean

Determines if the end of a string matches a specified string. Returns true if the instance string ends with string; otherwise returns false.

String.Equals

public override Equals(object), boolean

Compares two strings and determines if they have the same value. Returns true if object (@*) is a string and its contents are the same as this instance; otherwise returns false.

String.IndexOf

public IndexOf(string, startindex), int

Returns the 0‑based index position of the first occurrence of the specified string in this instance, beginning at startindex (int) and continuing to the end of the string.

String.LastIndexOf

public LastIndexOf(string, startindex), int

Returns the 0‑based index position of the last occurrence of the specified string in this instance, beginning at startindex (int) and working backward toward the beginning of the string.

String.Replace

public Replace(oldstring, newstring), string

Returns a new string in which all occurrences of oldstring in the current instance are replaced with newstring.

String.StartsWith

public StartsWith(string), boolean

Determines if the beginning of a string matches a specified string. Returns true if the instance string starts with string; otherwise returns false.

String.Substring

public Substring(startindex, length), string

Returns a substring from this instance, of the specified length (int) and that begins at the specified character position (int).

String.ToLower

public ToLower(), string

Returns a copy of the string in lowercase.

String.ToString

public override ToString(), string

Returns the value of this instance as a string.

String.ToUpper

public ToUpper(), string

Returns a copy of the string in uppercase.

String.Trim

public Trim(), string

Returns the current object with all leading and trailing white‑space characters removed.

Operators

The supported string operators are addition (+), equality (==), inequality (!=), and truth. See Object operators for more information. For example,

newstring = string + secondstring
if stringvar == "ABC"
if stringvar != "ABC"
if stringvar