Discussion Locked

Split String

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Dear all,
I want to split a string into twoparts.
How to do it?
For example, If I assigned variable called usrnm having string "QWUS\M0392".
But I want to split into two parts or I need only "M0392" from the string.How can I get it?
Will Mid or Replace function help for this?
Actually I am using ASP.Net
Please help me!
Thanks in advance!

2 replies

by nz_justice

use left and right

below is an example, I have outputted the result to two lables . lbl1 and lbl2.

Dim b As String
Dim c As String

b = 12345678
c = 12345678

Left(b, 4)
Right(c, 4)

lbl1.Text = Left(b, 4)
lbl2.Text = Right(c, 4)

This discussion is closed to new replies.