StringExtensionsSplit(String, String, Int32, StringSplitOptions) Method
Splits a string into a maximum number of substrings based on the specified string.
You can specify whether the substrings include empty array elements.
Namespace: DevCase.Extensions.StringExtensionsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[EditorBrowsableAttribute(EditorBrowsableState.Always)]
public static string[] Split(
this string sender,
string separator,
int count,
StringSplitOptions options
)
<ExtensionAttribute>
<EditorBrowsableAttribute(EditorBrowsableState.Always)>
Public Shared Function Split (
sender As String,
separator As String,
count As Integer,
options As StringSplitOptions
) As String()
Dim sender As String
Dim separator As String
Dim count As Integer
Dim options As StringSplitOptions
Dim returnValue As String()
returnValue = sender.Split(separator,
count, options)
public:
[ExtensionAttribute]
[EditorBrowsableAttribute(EditorBrowsableState::Always)]
static array<String^>^ Split(
String^ sender,
String^ separator,
int count,
StringSplitOptions options
)
[<ExtensionAttribute>]
[<EditorBrowsableAttribute(EditorBrowsableState.Always)>]
static member Split :
sender : string *
separator : string *
count : int *
options : StringSplitOptions -> string[]
No code example is currently available or this language may not be supported.
- sender String
-
The source String.
- separator String
-
A string that delimits the substrings in this string.
- count Int32
-
The maximum number of substrings to return.
- options StringSplitOptions
- RemoveEmptyEntries to omit empty array elements from the array returned.
None to include empty array elements in the array returned.
String
A
String array whose elements contain the substrings from this instance
that are delimited by the specified string in
separator.
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).
This is a code example.
No code example is currently available or this language may not be supported.
Dim str As String = "Hello" & Environment.NewLine & Environment.NewLine & "World"
Dim arr As String() = str.Split(ControlChars.NewLine, 3, StringSplitOptions.None)
For Each item As String In arr
Console.WriteLine(item)
Next
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.