Class Strings
Extension method equivalents to static methods from String.
Inherited Members
Namespace: Hgk.Zero.Strings
Assembly: Hgk.Zero.Strings.dll
Syntax
public static class Strings
Methods
| Improve this Doc View SourceConcatString(String, IEnumerable<String>)
Concatenates a string to the elements of a string sequence.
Declaration
public static string ConcatString(this string str, IEnumerable<string> values)
Parameters
Type | Name | Description |
---|---|---|
String | str | The first value to concatenate. |
IEnumerable<String> | values | The other values to concatenate. |
Returns
Type | Description |
---|---|
String | The concatenation of |
Remarks
If str
is null or empty, this method returns the
result of calling Concat(IEnumerable<String>). Otherwise, Concat(IEnumerable<String>) is called on the result of prepending
str
to values
.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ConcatString(String, Object)
Concatenates a string to the string representations of another object.
Declaration
public static string ConcatString(this string str, object arg0)
Parameters
Type | Name | Description |
---|---|---|
String | str | The first value to concatenate. |
Object | arg0 | The second value to concatenate. |
Returns
Type | Description |
---|---|
String | The concatenation of |
Remarks
This method returns the result of calling Concat(Object, Object).
ConcatString(String, Object, Object)
Concatenates a string to the string representations of two other objects.
Declaration
public static string ConcatString(this string str, object arg0, object arg1)
Parameters
Type | Name | Description |
---|---|---|
String | str | The first value to concatenate. |
Object | arg0 | The second value to concatenate. |
Object | arg1 | The third value to concatenate. |
Returns
Type | Description |
---|---|
String | The concatenation of |
Remarks
This method returns the result of calling Concat(Object, Object, Object).
ConcatString(String, Object, Object, Object)
Concatenates a string to the string representations of three other objects.
Declaration
public static string ConcatString(this string str, object arg0, object arg1, object arg2)
Parameters
Type | Name | Description |
---|---|---|
String | str | The first value to concatenate. |
Object | arg0 | The second value to concatenate. |
Object | arg1 | The third value to concatenate. |
Object | arg2 | The fourth value to concatenate. |
Returns
Type | Description |
---|---|
String | The concatenation of |
Remarks
This method concatenates str to the result of calling Concat(Object, Object, Object).
ConcatString(String, Object[])
Concatenates a string to the string representations of the elements of an object array.
Declaration
public static string ConcatString(this string str, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
String | str | The first value to concatenate. |
Object[] | args | The other values to concatenate. |
Returns
Type | Description |
---|---|
String | The concatenation of |
Remarks
If str
is null or empty, this method returns the
result of calling Concat(Object[]). Otherwise, Concat<T>(IEnumerable<T>) is called on the result of prepending str
to args
.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ConcatString(String, String)
Concatenates a string to another string.
Declaration
public static string ConcatString(this string str0, string str1)
Parameters
Type | Name | Description |
---|---|---|
String | str0 | The first string value to concatenate. |
String | str1 | The second string value to concatenate. |
Returns
Type | Description |
---|---|
String | The concatenation of |
Remarks
This method returns the result of calling Concat(String, String).
ConcatString(String, String, String)
Concatenates a string to two other strings.
Declaration
public static string ConcatString(this string str0, string str1, string str2)
Parameters
Type | Name | Description |
---|---|---|
String | str0 | The first string value to concatenate. |
String | str1 | The second string value to concatenate. |
String | str2 | The third string value to concatenate. |
Returns
Type | Description |
---|---|
String | The concatenation of |
Remarks
This method returns the result of calling Concat(String, String, String).
ConcatString(String, String, String, String)
Concatenates a string to three other strings.
Declaration
public static string ConcatString(this string str0, string str1, string str2, string str3)
Parameters
Type | Name | Description |
---|---|---|
String | str0 | The first string value to concatenate. |
String | str1 | The second string value to concatenate. |
String | str2 | The third string value to concatenate. |
String | str3 | The fourth string value to concatenate. |
Returns
Type | Description |
---|---|
String | The concatenation of |
Remarks
This method returns the result of calling Concat(String, String, String, String).
ConcatString(String, String[])
Concatenates a string to the elements of a string array.
Declaration
public static string ConcatString(this string str, params string[] values)
Parameters
Type | Name | Description |
---|---|---|
String | str | The first string value to concatenate. |
String[] | values | The other string values to concatenate. |
Returns
Type | Description |
---|---|
String | The concatenation of |
Remarks
If str
is null or empty, this method returns the
result of calling Concat(String[]). Otherwise, Concat(IEnumerable<String>) is called on the result of prepending
str
to values
.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ConcatString<T>(String, IEnumerable<T>)
Concatenates a string to the string representations of the elements of a sequence.
Declaration
public static string ConcatString<T>(this string str, IEnumerable<T> values)
Parameters
Type | Name | Description |
---|---|---|
String | str | The first value to concatenate. |
IEnumerable<T> | values | The other values to concatenate. |
Returns
Type | Description |
---|---|
String | The concatenation of |
Type Parameters
Name | Description |
---|---|
T | The type of the elements of |
Remarks
If str
is null or empty, this method returns the
result of calling Concat<T>(IEnumerable<T>). Otherwise, Concat<T>(IEnumerable<T>) is called on the result of converting values
to an Object sequence and prepending str
to the sequence.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
IsNullOrEmpty(String)
Returns whether the specified string is null or empty (zero-length).
Declaration
public static bool IsNullOrEmpty(this string value)
Parameters
Type | Name | Description |
---|---|---|
String | value | A string to test. |
Returns
Type | Description |
---|---|
Boolean | true if |
Remarks
This method returns the result of calling IsNullOrEmpty(String).
IsNullOrWhiteSpace(String)
Returns whether the specified string is null, empty (zero-length), or contains only whitespace characters.
Declaration
public static bool IsNullOrWhiteSpace(this string value)
Parameters
Type | Name | Description |
---|---|---|
String | value | A string to test. |
Returns
Type | Description |
---|---|
Boolean | true if |
Remarks
A character is a whitespace character if the result of calling IsWhiteSpace(Char) on the character is true.
This method returns the result of IsNullOrWhiteSpace(String).
JoinString(String, IEnumerable<String>)
Concatenates the elements of a string sequence using the specified string as a separator.
Declaration
public static string JoinString(this string separator, IEnumerable<string> values)
Parameters
Type | Name | Description |
---|---|---|
String | separator | A string to use as a separator. (If null, an empty string is used.) |
IEnumerable<String> | values | The strings to concatenate. |
Returns
Type | Description |
---|---|
String | The concatenation of the values in |
Remarks
This method returns the result of calling Join(String, IEnumerable<String>).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
JoinString(String, Object[])
Concatenates the string representations of the elements of an array using the specified string as a separator.
Declaration
public static string JoinString(this string separator, params object[] values)
Parameters
Type | Name | Description |
---|---|---|
String | separator | A string to use as a separator. (If null, an empty string is used.) |
Object[] | values | The values to concatenate. |
Returns
Type | Description |
---|---|
String | The concatenation of the string representations of the values in |
Remarks
This method returns the result of calling Join(String, Object[]).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
JoinString(String, String[])
Concatenates the elements of a string array using the specified string as a separator.
Declaration
public static string JoinString(this string separator, params string[] values)
Parameters
Type | Name | Description |
---|---|---|
String | separator | A string to use as a separator. (If null, an empty string is used.) |
String[] | values | The strings to concatenate. |
Returns
Type | Description |
---|---|
String | The concatenation of the values in |
Remarks
This method returns the result of calling Join(String, String[]).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
JoinString(String, String[], Int32, Int32)
Concatenates the specified elements of a string array using the specified string as a separator.
Declaration
public static string JoinString(this string separator, string[] values, int startIndex, int count)
Parameters
Type | Name | Description |
---|---|---|
String | separator | A string to use as a separator. (If null, an empty string is used.) |
String[] | values | An array containing strings to concatenate. |
Int32 | startIndex | The first index of |
Int32 | count | The number of elements of |
Returns
Type | Description |
---|---|
String | The concatenation of the values in the specified range of |
Remarks
This method returns the result of calling Join(String, String[], Int32, Int32).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
JoinString<T>(String, IEnumerable<T>)
Concatenates the string representations of the elements of a sequence using the specified string as a separator.
Declaration
public static string JoinString<T>(this string separator, IEnumerable<T> values)
Parameters
Type | Name | Description |
---|---|---|
String | separator | A string to use as a separator. (If null, an empty string is used.) |
IEnumerable<T> | values | The values to concatenate. |
Returns
Type | Description |
---|---|
String | The concatenation of the string representations of the values in |
Type Parameters
Name | Description |
---|---|
T | The type of elements of |
Remarks
This method returns the result of calling Join<T>(String, IEnumerable<T>).
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|