vb.net - How to split textbox value then display splitted value on label -


how split text box (delimited "-") value display split values on 2 labels?

heres code:

    dim s string     dim substring string     dim sp() string      s = txttime1.text 'this text box contains value (08:00-17:41)     sp = s.split("-")      each substring in sp         txttimein.text = substring         txttimeout.text = substring     next 

my problem txttimein , txttimeout displays value '17:41'. thank in advance.

try this:

dim s string dim substring string dim sp() string  s = txttime1.text 'this text box contains value (08:00-17:41) sp = s.split("-")  txttimein.text = sp(0) txttimeout.text = sp(1) 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -