Class StringExtensions
Inherited Members
Namespace: Couchbase.Core.Utils
Assembly: Couchbase.NetClient.dll
Syntax
public static class StringExtensions
Methods
| Edit this page View SourceContains(string, string, StringComparison)
Allows for case and cultural insensitive comparisons
Declaration
public static bool Contains(this string source, string value, StringComparison comparison)
Parameters
Type | Name | Description |
---|---|---|
string | source | The incoming string to compare. |
string | value | The value to check for. |
StringComparison | comparison | The StringComparison to use. |
Returns
Type | Description |
---|---|
bool |
EscapeIfRequired(string)
Adds back ticks to the beginning and end of a string if they do not already exist.
Declaration
public static string EscapeIfRequired(this string value)
Parameters
Type | Name | Description |
---|---|---|
string | value | A value such as a bucket or scope name. |
Returns
Type | Description |
---|---|
string | The original value escaped with back ticks. |
ToHexString(uint)
Declaration
public static string ToHexString(this uint opaque)
Parameters
Type | Name | Description |
---|---|---|
uint | opaque |
Returns
Type | Description |
---|---|
string |
ToStringInvariant(double)
Convert a double to string using the Invariant culture.
Declaration
public static string ToStringInvariant(this double num)
Parameters
Type | Name | Description |
---|---|---|
double | num | The double to convert. |
Returns
Type | Description |
---|---|
string | A string representation of the value. |
ToStringInvariant(short)
Convert a short integer to string using the Invariant culture.
Declaration
public static string ToStringInvariant(this short num)
Parameters
Type | Name | Description |
---|---|---|
short | num | The integer to convert. |
Returns
Type | Description |
---|---|
string | A string representation of the value. |
ToStringInvariant(int)
Convert an int to string using the Invariant culture.
Declaration
public static string ToStringInvariant(this int num)
Parameters
Type | Name | Description |
---|---|---|
int | num | The integer to convert. |
Returns
Type | Description |
---|---|
string | A string representation of the value. |
ToStringInvariant(long)
Convert a long to string using the Invariant culture.
Declaration
public static string ToStringInvariant(this long num)
Parameters
Type | Name | Description |
---|---|---|
long | num | The long to convert. |
Returns
Type | Description |
---|---|
string | A string representation of the value. |
ToStringInvariant(uint)
Convert a uint to string using the Invariant culture.
Declaration
public static string ToStringInvariant(this uint num)
Parameters
Type | Name | Description |
---|---|---|
uint | num | The integer to convert. |
Returns
Type | Description |
---|---|
string | A string representation of the value. |
ToStringInvariant(ulong)
Convert a ulong to string using the Invariant culture.
Declaration
public static string ToStringInvariant(this ulong num)
Parameters
Type | Name | Description |
---|---|---|
ulong | num | The ulong to convert. |
Returns
Type | Description |
---|---|
string | A string representation of the value. |