Open topic with navigation
WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
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.
Returns the number of characters in the string. (int)
Returns a reference to this instance of String.
public static Concat(string1, string2), string
Concatenates string1 and string2 and returns the resulting string.
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.
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.
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.
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.
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.
public Replace(oldstring, newstring), string
Returns a new string in which all occurrences of oldstring in the current instance are replaced with newstring.
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.
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).
public ToLower(), string
Returns a copy of the string in lowercase.
public override ToString(), string
Returns the value of this instance as a string.
public ToUpper(), string
Returns a copy of the string in uppercase.
public Trim(), string
Returns the current object with all leading and trailing white‑space characters removed.
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"