Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to split a string with multi-character delimiter in vb - asp.net?

How should I split a string separated by a multi-character delimiter in VB?

i.e. If my string is say - Elephant##Monkey, How do I split it with "##" ?

Thanks!

like image 285
user355562 Avatar asked Jun 21 '10 18:06

user355562


People also ask

How do you split a character in a string in VB net?

Split() The VB.Net Split() extracts the substrings from the given string that are delimited by the separator parameter, and returns those substrings as elements of an array. If your String contains "dd-mm-yy", split on the "-" character to get an array of: "dd" "mm" "yy".

How cut a string in VB net?

Try Mid(txtCpu. Text, Len(txtCpu. Text) - 6, 3) - the last parameter is the length of the string you want, not an absolute position.

How Split Comma Separated Values in VB net?

Split We call Split() with a Char array with 1 element—the comma char. This separates each line on the comma. RemoveEmptyEntries. Sometimes there are no characters between two delimiters.

How can I remove last character from a string in VB net?

In c# or vb.net we can easily remove last character from string by using Remove or Trim or IndexOf properties.


1 Answers

Dim words As String() = myStr.Split(new String() { "##" }, 
                                        StringSplitOptions.None)
like image 175
womp Avatar answered Nov 09 '22 04:11

womp