Click or drag to resize

imbSciStringExtensionsSplitSmart Method

imbSCI | imbACE | imbNLP | imbWEM | imbWBI
Splits the string or if no needle found in the string it returs target string

Namespace:  imbSCI.Data
Assembly:  imbSCI.Data (in imbSCI.Data.dll) Version: 0.3.70.
Syntax
C#
public static List<string> SplitSmart(
	this string target,
	string needle,
	string targetDefault = "",
	bool trimResults = false,
	bool removeEmptyResults = true
)
Request Example View Source

Parameters

target
Type: SystemString
The target.
needle
Type: SystemString
The needle.
targetDefault (Optional)
Type: SystemString
If the target is null or empty it will use this value
trimResults (Optional)
Type: SystemBoolean
removeEmptyResults (Optional)
Type: SystemBoolean

Return Value

Type: ListString
List with one (if no needle found, original string) or two strings (if needle found, left and right substrings

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also