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
initialPathstringThe first path to combine. This can be absolute or relative.
pathsstring[]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
sourcestringString to search for matches
valuestringThe string to seek
comparisonStringComparison Comparison rule
Returns
- bool
true if the value parameter occurs within this string, or if value is the empty string (""); otherwise, false.
IsNotNullOrEmpty(string?)
A nicer way of calling the inverse of Is
Parameters
valuestringThe 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
valuestringThe 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
inputstringThe 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
inputstringThe input.
oldValuestringThe old value.
newValuestringThe new value.
optionsRegexOptions The options.
Returns
- string
System.String.
UrlEscape(string?)
Returns a URL encoded string of the provided input string value.
Parameters
valuestring
Returns
- string
URL encoded value