Class StringExtensions
- Namespace
- Dynamicweb.Core
- Assembly
- Dynamicweb.Core.dll
Extensions for string
- Inheritance
-
String
Extensions
- Inherited Members
Methods
CombinePaths(string, params string[]?)
Combines any number of file system paths properly.
Parameters
initialPath
stringThe first path to combine. This can be absolute or relative.
paths
string[]The paths to combine with initialPath. These are relative to initialPath.
Returns
- string
The combined path.
Contains(string, string, StringComparison)
Returns a value indicating whether a specified substring occurs within this string.
Parameters
source
stringString to search for matches
value
stringThe string to seek
comparison
StringComparison Comparison rule
Returns
- bool
true if the value parameter occurs within this string, or if value is the empty string (""); otherwise, false.
FormatWith(string, params object[])
A nicer way of calling Format(string,
Parameters
format
stringA composite format string.
args
object[]An object array that contains zero or more objects to format.
Returns
- string
A copy of format in which the format items have been replaced by the string representation of the corresponding objects in args.
IsNotNullOrEmpty(string?)
A nicer way of calling the inverse of Is
Parameters
value
stringThe string to test.
Returns
- bool
true if the value parameter is not null or an empty string (""); otherwise, false.
IsNullOrEmpty(string?)
A nicer way of calling Is
Parameters
value
stringThe string to test.
Returns
- bool
true if the value parameter is null or an empty string (""); otherwise, false.
IsNumeric(string)
Returns a value indicating if the string is numeric
Parameters
input
stringThe string to test if is numeric
Returns
- bool
True if the string is numeric, otherwise false
Replace(string, string, string, RegexOptions)
Replaces the specified old value with the new value in the input.
public static string Replace(this string input, string oldValue, string newValue, RegexOptions options)
Parameters
input
stringThe input.
oldValue
stringThe old value.
newValue
stringThe new value.
options
RegexOptions The options.
Returns
- string
System.String.