Table of Contents

Class String

Namespace
Java.Lang
Assembly
MASES.JNet.dll
public class String : JVMBridgeBase<String>, IDynamicMetaObjectProvider, IJVMBridgeCore, IEquatable<IJVMBridgeBaseInstance>, IDisposable, IJVMBridgeBaseStatic, IJVMBridgeBase, IJVMBridgeBaseInstance, IJVMBridgeDefinition, INativeConvertible<String, string>, IComparable<String>, IEquatable<String>, IStringJavaObject
Inheritance
String
Implements
Extension Methods

Constructors

String()

public String()

String(String)

public String(String arg0)

Parameters

arg0 String

String

String(StringBuffer)

public String(StringBuffer arg0)

Parameters

arg0 StringBuffer

StringBuffer

String(StringBuilder)

public String(StringBuilder arg0)

Parameters

arg0 StringBuilder

StringBuilder

String(IJVMBridgeBaseInitializer)

Initializer used internally by JCOBridge. Do not use directly.

[Obsolete("This public initializer is needed for JCOBridge internal use, other uses can produce unidentible behaviors.")]
public String(IJVMBridgeBaseInitializer initializer)

Parameters

initializer IJVMBridgeBaseInitializer

String(byte[])

public String(byte[] arg0)

Parameters

arg0 byte[]

byte

String(byte[], String)

public String(byte[] arg0, String arg1)

Parameters

arg0 byte[]

byte

arg1 String

String

Exceptions

UnsupportedEncodingException

String(byte[], Charset)

public String(byte[] arg0, Charset arg1)

Parameters

arg0 byte[]

byte

arg1 Charset

Charset

String(byte[], int)

[Obsolete("Deprecated in JVM")]
public String(byte[] arg0, int arg1)

Parameters

arg0 byte[]

byte

arg1 int

int

String(byte[], int, int)

public String(byte[] arg0, int arg1, int arg2)

Parameters

arg0 byte[]

byte

arg1 int

int

arg2 int

int

String(byte[], int, int, String)

public String(byte[] arg0, int arg1, int arg2, String arg3)

Parameters

arg0 byte[]

byte

arg1 int

int

arg2 int

int

arg3 String

String

Exceptions

UnsupportedEncodingException

String(byte[], int, int, Charset)

public String(byte[] arg0, int arg1, int arg2, Charset arg3)

Parameters

arg0 byte[]

byte

arg1 int

int

arg2 int

int

arg3 Charset

Charset

String(byte[], int, int, int)

[Obsolete("Deprecated in JVM")]
public String(byte[] arg0, int arg1, int arg2, int arg3)

Parameters

arg0 byte[]

byte

arg1 int

int

arg2 int

int

arg3 int

int

String(char[])

public String(char[] arg0)

Parameters

arg0 char[]

char

String(char[], int, int)

public String(char[] arg0, int arg1, int arg2)

Parameters

arg0 char[]

char

arg1 int

int

arg2 int

int

String(int[], int, int)

public String(int[] arg0, int arg1, int arg2)

Parameters

arg0 int[]

int

arg1 int

int

arg2 int

int

String(string)

public String(string arg0)

Parameters

arg0 string

string

Properties

BridgeClassName

Java class name to be instantiated

public override string BridgeClassName { get; }

Property Value

string

Bytes

public byte[] Bytes { get; }

Property Value

byte[]

CASE_INSENSITIVE_ORDER

public static Comparator CASE_INSENSITIVE_ORDER { get; set; }

Property Value

Comparator

IsBridgeAbstract

true if the BridgeClassName is an abstract class, i.e. cannot be created an instance

public override bool IsBridgeAbstract { get; }

Property Value

bool

IsBridgeCloseable

true if the BridgeClassName implements java.lang.AutoCloseable

public override bool IsBridgeCloseable { get; }

Property Value

bool

IsBridgeInterface

true if the BridgeClassName is an interface, i.e. does not have any public constructor

public override bool IsBridgeInterface { get; }

Property Value

bool

IsBridgeStatic

true if the BridgeClassName is a static class, i.e. does not have any public constructor

public override bool IsBridgeStatic { get; }

Property Value

bool

IsNullOrEmpty

Indicates whether the specified string is null or an Empty string.

public bool IsNullOrEmpty { get; }

Property Value

bool

true if the value parameter is null or an empty string (""); otherwise, false.

Exceptions

InvalidOperationException

If current instance is not a JVM string

IsNullOrWhiteSpace

Indicates whether a specified string is null, empty, or consists only of white-space characters.

public bool IsNullOrWhiteSpace { get; }

Property Value

bool

true if the value parameter is null or Empty, or if value consists exclusively of white-space characters.

Exceptions

InvalidOperationException

If current instance is not a JVM string

this[int]

Returns the character at index

public char this[int index] { get; }

Parameters

index int

The index of the character to return

Property Value

char

char at index

Methods

CharAt(int)

public char CharAt(int arg0)

Parameters

arg0 int

int

Returns

char

char

CodePointAt(int)

public int CodePointAt(int arg0)

Parameters

arg0 int

int

Returns

int

int

CodePointBefore(int)

public int CodePointBefore(int arg0)

Parameters

arg0 int

int

Returns

int

int

CodePointCount(int, int)

public int CodePointCount(int arg0, int arg1)

Parameters

arg0 int

int

arg1 int

int

Returns

int

int

CompareTo(String)

public int CompareTo(String arg0)

Parameters

arg0 String

String

Returns

int

int

CompareTo(object)

public int CompareTo(object arg0)

Parameters

arg0 object

object

Returns

int

int

CompareTo(string)

Compares this instance with a specified string object and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified string.

public int CompareTo(string other)

Parameters

other string

Returns

int

A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the strB parameter.Value Condition Less than zero This instance precedes strB. Zero This instance has the same position in the sort order as strB. Greater than zero This instance follows strB.-or- strB is null.

Exceptions

InvalidOperationException

If current instance is not a JVM string

CompareToIgnoreCase(String)

public int CompareToIgnoreCase(String arg0)

Parameters

arg0 String

String

Returns

int

int

Concat(String)

public String Concat(String arg0)

Parameters

arg0 String

String

Returns

String

String

Contains(CharSequence)

public bool Contains(CharSequence arg0)

Parameters

arg0 CharSequence

CharSequence

Returns

bool

bool

Contains(char)

Returns a value indicating whether a specified substring occurs within this string.

public bool Contains(char value)

Parameters

value char

The string to seek.

Returns

bool

true if the value parameter occurs within this string, or if value is the empty string (""); otherwise, false.

Exceptions

ArgumentNullException

value is null.

InvalidOperationException

If current instance is not a JVM string

Contains(string)

Returns a value indicating whether a specified substring occurs within this string.

public bool Contains(string value)

Parameters

value string

The string to seek.

Returns

bool

true if the value parameter occurs within this string, or if value is the empty string (""); otherwise, false.

Exceptions

ArgumentNullException

value is null.

InvalidOperationException

If current instance is not a JVM string

ContentEquals(CharSequence)

public bool ContentEquals(CharSequence arg0)

Parameters

arg0 CharSequence

CharSequence

Returns

bool

bool

ContentEquals(StringBuffer)

public bool ContentEquals(StringBuffer arg0)

Parameters

arg0 StringBuffer

StringBuffer

Returns

bool

bool

CopyValueOf(char[])

public static String CopyValueOf(char[] arg0)

Parameters

arg0 char[]

char

Returns

String

String

CopyValueOf(char[], int, int)

public static String CopyValueOf(char[] arg0, int arg1, int arg2)

Parameters

arg0 char[]

char

arg1 int

int

arg2 int

int

Returns

String

String

CreatePoolableInstance()

HPA initializer for String()

public static String CreatePoolableInstance()

Returns

String

CreatePoolableInstance(String)

HPA initializer for String(Java.Lang.String arg0)

public static String CreatePoolableInstance(String arg0)

Parameters

arg0 String

Returns

String

CreatePoolableInstance(StringBuffer)

HPA initializer for String(Java.Lang.StringBuffer arg0)

public static String CreatePoolableInstance(StringBuffer arg0)

Parameters

arg0 StringBuffer

Returns

String

CreatePoolableInstance(StringBuilder)

HPA initializer for String(Java.Lang.StringBuilder arg0)

public static String CreatePoolableInstance(StringBuilder arg0)

Parameters

arg0 StringBuilder

Returns

String

CreatePoolableInstance(byte[])

HPA initializer for String(byte[] arg0)

public static String CreatePoolableInstance(byte[] arg0)

Parameters

arg0 byte[]

Returns

String

CreatePoolableInstance(byte[], String)

HPA initializer for String(byte[] arg0, Java.Lang.String arg1)

public static String CreatePoolableInstance(byte[] arg0, String arg1)

Parameters

arg0 byte[]
arg1 String

Returns

String

CreatePoolableInstance(byte[], Charset)

HPA initializer for String(byte[] arg0, Java.Nio.Charset.Charset arg1)

public static String CreatePoolableInstance(byte[] arg0, Charset arg1)

Parameters

arg0 byte[]
arg1 Charset

Returns

String

CreatePoolableInstance(byte[], int)

HPA initializer for String(byte[] arg0, int arg1)

public static String CreatePoolableInstance(byte[] arg0, int arg1)

Parameters

arg0 byte[]
arg1 int

Returns

String

CreatePoolableInstance(byte[], int, int)

HPA initializer for String(byte[] arg0, int arg1, int arg2)

public static String CreatePoolableInstance(byte[] arg0, int arg1, int arg2)

Parameters

arg0 byte[]
arg1 int
arg2 int

Returns

String

CreatePoolableInstance(byte[], int, int, String)

HPA initializer for String(byte[] arg0, int arg1, int arg2, Java.Lang.String arg3)

public static String CreatePoolableInstance(byte[] arg0, int arg1, int arg2, String arg3)

Parameters

arg0 byte[]
arg1 int
arg2 int
arg3 String

Returns

String

CreatePoolableInstance(byte[], int, int, Charset)

HPA initializer for String(byte[] arg0, int arg1, int arg2, Java.Nio.Charset.Charset arg3)

public static String CreatePoolableInstance(byte[] arg0, int arg1, int arg2, Charset arg3)

Parameters

arg0 byte[]
arg1 int
arg2 int
arg3 Charset

Returns

String

CreatePoolableInstance(byte[], int, int, int)

HPA initializer for String(byte[] arg0, int arg1, int arg2, int arg3)

public static String CreatePoolableInstance(byte[] arg0, int arg1, int arg2, int arg3)

Parameters

arg0 byte[]
arg1 int
arg2 int
arg3 int

Returns

String

CreatePoolableInstance(char[])

HPA initializer for String(char[] arg0)

public static String CreatePoolableInstance(char[] arg0)

Parameters

arg0 char[]

Returns

String

CreatePoolableInstance(char[], int, int)

HPA initializer for String(char[] arg0, int arg1, int arg2)

public static String CreatePoolableInstance(char[] arg0, int arg1, int arg2)

Parameters

arg0 char[]
arg1 int
arg2 int

Returns

String

CreatePoolableInstance(int[], int, int)

HPA initializer for String(int[] arg0, int arg1, int arg2)

public static String CreatePoolableInstance(int[] arg0, int arg1, int arg2)

Parameters

arg0 int[]
arg1 int
arg2 int

Returns

String

EndsWith(String)

public bool EndsWith(String arg0)

Parameters

arg0 String

String

Returns

bool

bool

EndsWith(string)

Determines whether the end of this string instance matches the specified string.

public bool EndsWith(string suffix)

Parameters

suffix string

Returns

bool

true if value matches the end of this instance; otherwise, false.

Exceptions

ArgumentNullException

value is null.

InvalidOperationException

If current instance is not a JVM string

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

Equals(string)

Determines whether this instance and another specified string object have the same value.

public bool Equals(string other)

Parameters

other string

Returns

bool

true if the value of the value parameter is the same as the value of this instance; otherwise, false. If value is null, the method returns false.

Exceptions

InvalidOperationException

If current instance is not a JVM string

EqualsIgnoreCase(String)

public bool EqualsIgnoreCase(String arg0)

Parameters

arg0 String

String

Returns

bool

bool

Format(String, params object[])

public static String Format(String arg0, params object[] arg1)

Parameters

arg0 String

String

arg1 object[]

object

Returns

String

String

Format(Locale, String, params object[])

public static String Format(Locale arg0, String arg1, params object[] arg2)

Parameters

arg0 Locale

Locale

arg1 String

String

arg2 object[]

object

Returns

String

String

GetBytes(String)

public byte[] GetBytes(String arg0)

Parameters

arg0 String

String

Returns

byte[]

byte

Exceptions

UnsupportedEncodingException

GetBytes(Charset)

public byte[] GetBytes(Charset arg0)

Parameters

arg0 Charset

Charset

Returns

byte[]

byte

GetBytes(int, int, byte[], int)

[Obsolete("Deprecated in JVM")]
public void GetBytes(int arg0, int arg1, byte[] arg2, int arg3)

Parameters

arg0 int

int

arg1 int

int

arg2 byte[]

byte

arg3 int

int

GetChars(int, int, char[], int)

public void GetChars(int arg0, int arg1, char[] arg2, int arg3)

Parameters

arg0 int

int

arg1 int

int

arg2 char[]

char

arg3 int

int

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

IndexOf(String)

public int IndexOf(String arg0)

Parameters

arg0 String

String

Returns

int

int

IndexOf(String, int)

public int IndexOf(String arg0, int arg1)

Parameters

arg0 String

String

arg1 int

int

Returns

int

int

IndexOf(char)

Reports the zero-based index of the first occurrence of the specified Unicode character in this string.

public int IndexOf(char value)

Parameters

value char

A Unicode character to seek.

Returns

int

The zero-based index position of value if that character is found, or -1 if it is not.

Exceptions

InvalidOperationException

If current instance is not a JVM string

IndexOf(int)

public int IndexOf(int arg0)

Parameters

arg0 int

int

Returns

int

int

IndexOf(int, int)

public int IndexOf(int arg0, int arg1)

Parameters

arg0 int

int

arg1 int

int

Returns

int

int

IndexOf(string)

Reports the zero-based index of the first occurrence of the specified string in this instance.

public int IndexOf(string value)

Parameters

value string

The string to seek.

Returns

int

The zero-based index position of value if that string is found, or -1 if it is not. If value is Empty, the return value is 0.

Exceptions

ArgumentNullException

value is null.

InvalidOperationException

If current instance is not a JVM string

IndexOfAny(char[])

Reports the zero-based index of the first occurrence in this instance of any character in a specified array of Unicode characters.

public int IndexOfAny(char[] values)

Parameters

values char[]

Returns

int

The zero-based index position of the first occurrence in this instance where any character in anyOf was found; -1 if no character in anyOf was found.

Exceptions

ArgumentNullException

anyOf is null.

InvalidOperationException

If current instance is not a JVM string

Intern()

public String Intern()

Returns

String

String

IsEmpty()

public bool IsEmpty()

Returns

bool

bool

Join(CharSequence, params CharSequence[])

public static String Join(CharSequence arg0, params CharSequence[] arg1)

Parameters

arg0 CharSequence

CharSequence

arg1 CharSequence[]

CharSequence

Returns

String

String

Join<Arg1ExtendsJava_Lang_CharSequence>(CharSequence, Iterable<Arg1ExtendsJava_Lang_CharSequence>)

public static String Join<Arg1ExtendsJava_Lang_CharSequence>(CharSequence arg0, Iterable<Arg1ExtendsJava_Lang_CharSequence> arg1) where Arg1ExtendsJava_Lang_CharSequence : CharSequence

Parameters

arg0 CharSequence

CharSequence

arg1 Iterable<Arg1ExtendsJava_Lang_CharSequence>

Iterable

Returns

String

String

Type Parameters

Arg1ExtendsJava_Lang_CharSequence

CharSequence

LastIndexOf(String)

public int LastIndexOf(String arg0)

Parameters

arg0 String

String

Returns

int

int

LastIndexOf(String, int)

public int LastIndexOf(String arg0, int arg1)

Parameters

arg0 String

String

arg1 int

int

Returns

int

int

LastIndexOf(char)

Reports the zero-based index position of the last occurrence of a specified Unicode character within this instance.

public int LastIndexOf(char value)

Parameters

value char

The Unicode character to seek.

Returns

int

The zero-based index position of value if that character is found, or -1 if it is not.

Exceptions

InvalidOperationException

If current instance is not a JVM string

LastIndexOf(int)

public int LastIndexOf(int arg0)

Parameters

arg0 int

int

Returns

int

int

LastIndexOf(int, int)

public int LastIndexOf(int arg0, int arg1)

Parameters

arg0 int

int

arg1 int

int

Returns

int

int

LastIndexOf(string)

Reports the zero-based index position of the last occurrence of a specified string within this instance.

public int LastIndexOf(string value)

Parameters

value string

The string to seek.

Returns

int

The zero-based starting index position of value if that string is found, or -1 if it is not. If value is Empty, the return value is the last index position in this instance.

Exceptions

ArgumentNullException

value is null.

InvalidOperationException

If current instance is not a JVM string

LastIndexOfAny(char[])

Reports the zero-based index position of the last occurrence in this instance of one or more characters specified in a Unicode array.

public int LastIndexOfAny(char[] values)

Parameters

values char[]

Returns

int

The index position of the last occurrence in this instance where any character in anyOf was found; -1 if no character in anyOf was found.

Exceptions

ArgumentNullException

anyOf is null.

InvalidOperationException

If current instance is not a JVM string

Length()

public int Length()

Returns

int

int

Matches(String)

public bool Matches(String arg0)

Parameters

arg0 String

String

Returns

bool

bool

OffsetByCodePoints(int, int)

public int OffsetByCodePoints(int arg0, int arg1)

Parameters

arg0 int

int

arg1 int

int

Returns

int

int

RegionMatches(bool, int, String, int, int)

public bool RegionMatches(bool arg0, int arg1, String arg2, int arg3, int arg4)

Parameters

arg0 bool

bool

arg1 int

int

arg2 String

String

arg3 int

int

arg4 int

int

Returns

bool

bool

RegionMatches(int, String, int, int)

public bool RegionMatches(int arg0, String arg1, int arg2, int arg3)

Parameters

arg0 int

int

arg1 String

String

arg2 int

int

arg3 int

int

Returns

bool

bool

Replace(CharSequence, CharSequence)

public String Replace(CharSequence arg0, CharSequence arg1)

Parameters

arg0 CharSequence

CharSequence

arg1 CharSequence

CharSequence

Returns

String

String

Replace(char, char)

public String Replace(char arg0, char arg1)

Parameters

arg0 char

char

arg1 char

char

Returns

String

String

ReplaceAll(String, String)

public String ReplaceAll(String arg0, String arg1)

Parameters

arg0 String

String

arg1 String

String

Returns

String

String

ReplaceFirst(String, String)

public String ReplaceFirst(String arg0, String arg1)

Parameters

arg0 String

String

arg1 String

String

Returns

String

String

Split(String)

public String[] Split(String arg0)

Parameters

arg0 String

String

Returns

String[]

String

Split(String, int)

public String[] Split(String arg0, int arg1)

Parameters

arg0 String

String

arg1 int

int

Returns

String[]

String

StartsWith(String)

public bool StartsWith(String arg0)

Parameters

arg0 String

String

Returns

bool

bool

StartsWith(String, int)

public bool StartsWith(String arg0, int arg1)

Parameters

arg0 String

String

arg1 int

int

Returns

bool

bool

StartsWith(string)

Determines whether the beginning of this string instance matches the specified string.

public bool StartsWith(string prefix)

Parameters

prefix string

Returns

bool

true if value matches the beginning of this string; otherwise, false.

Exceptions

ArgumentNullException

value is null.

InvalidOperationException

If current instance is not a JVM string

SubSequence(int, int)

public CharSequence SubSequence(int arg0, int arg1)

Parameters

arg0 int

int

arg1 int

int

Returns

CharSequence

CharSequence

Substring(int)

public String Substring(int arg0)

Parameters

arg0 int

int

Returns

String

String

Substring(int, int)

public String Substring(int arg0, int arg1)

Parameters

arg0 int

int

arg1 int

int

Returns

String

String

ToCharArray()

public char[] ToCharArray()

Returns

char[]

char

ToJVM(string)

Returns the String from the clrValue instance

public static String ToJVM(string clrValue)

Parameters

clrValue string

The string of CLR

Returns

String

The converted String

ToLowerCase()

public String ToLowerCase()

Returns

String

String

ToLowerCase(Locale)

public String ToLowerCase(Locale arg0)

Parameters

arg0 Locale

Locale

Returns

String

String

ToUpperCase()

public String ToUpperCase()

Returns

String

String

ToUpperCase(Locale)

public String ToUpperCase(Locale arg0)

Parameters

arg0 Locale

Locale

Returns

String

String

Trim()

public String Trim()

Returns

String

String

ValueOf(bool)

public static String ValueOf(bool arg0)

Parameters

arg0 bool

bool

Returns

String

String

ValueOf(char)

public static String ValueOf(char arg0)

Parameters

arg0 char

char

Returns

String

String

ValueOf(char[])

public static String ValueOf(char[] arg0)

Parameters

arg0 char[]

char

Returns

String

String

ValueOf(char[], int, int)

public static String ValueOf(char[] arg0, int arg1, int arg2)

Parameters

arg0 char[]

char

arg1 int

int

arg2 int

int

Returns

String

String

ValueOf(double)

public static String ValueOf(double arg0)

Parameters

arg0 double

double

Returns

String

String

ValueOf(int)

public static String ValueOf(int arg0)

Parameters

arg0 int

int

Returns

String

String

ValueOf(long)

public static String ValueOf(long arg0)

Parameters

arg0 long

long

Returns

String

String

ValueOf(object)

public static String ValueOf(object arg0)

Parameters

arg0 object

object

Returns

String

String

ValueOf(float)

public static String ValueOf(float arg0)

Parameters

arg0 float

float

Returns

String

String

Operators

operator +(String, String)

Binary operator managing concatanation within JVM

public static String operator +(String a, String b)

Parameters

a String

The left String

b String

The right String

Returns

String

A new String which is the concatanation of a and b

Remarks

This overload can be very helpful because it avoids to move string contant from JVM to .NET and viceversa

operator ==(String, String)

Checks equality between two String instances.

public static bool operator ==(String left, String right)

Parameters

left String
right String

Returns

bool

operator ==(String, string)

Checks equality between a String and a string.

public static bool operator ==(String left, string right)

Parameters

left String
right string

Returns

bool

operator ==(string, String)

Checks equality between a string and a String.

public static bool operator ==(string left, String right)

Parameters

left string
right String

Returns

bool

implicit operator Serializable(String)

Converter from String to Serializable

public static implicit operator Serializable(String t)

Parameters

t String

Returns

Serializable

implicit operator CharSequence(String)

Converter from String to CharSequence

public static implicit operator CharSequence(String t)

Parameters

t String

Returns

CharSequence

implicit operator Comparable(String)

Converter from String to Comparable

public static implicit operator Comparable(String t)

Parameters

t String

Returns

Comparable

implicit operator string(String)

Converter from String to string

public static implicit operator string(String b)

Parameters

b String

Returns

string

implicit operator String(string)

Converter from string to String

public static implicit operator String(string b)

Parameters

b string

Returns

String

operator !=(String, String)

Checks inequality between two String instances.

public static bool operator !=(String left, String right)

Parameters

left String
right String

Returns

bool

operator !=(String, string)

Checks inequality between a String and a string.

public static bool operator !=(String left, string right)

Parameters

left String
right string

Returns

bool

operator !=(string, String)

Checks inequality between a string and a String.

public static bool operator !=(string left, String right)

Parameters

left string
right String

Returns

bool