Hello! I need code for separation of one word from array in bracket.
For example:
Word1 (Word2)
What I want, is to separate Word1 on the one side and Word2 on the other side.
Thanks!
Printable View
Hello! I need code for separation of one word from array in bracket.
For example:
Word1 (Word2)
What I want, is to separate Word1 on the one side and Word2 on the other side.
Thanks!
So this is a string?
In which case;
Code:Dim s As String = "Word1 (Word2)"
Dim a As String = s.Substring(0, s.IndexOf(" "))
Dim b As String = s.Substring(s.IndexOf("(") + 1, s.Length - s.IndexOf("(") - 2)
Yes, but Word1 and Word2 are variables from textbox! Which code in this case?
So this string appears in a TextBox?, is that right?
Code:
Dim s As String = TextBox1.Text
Dim a As String = s.Substring(0, s.IndexOf(" "))
Dim b As String = s.Substring(s.IndexOf("(") + 1, s.Length - s.IndexOf("(") - 2)
Thanks a lot!