string - VB.NET display letters of a word under eachother in a label -
string - VB.NET display letters of a word under eachother in a label -
dim intlength, intteller integer dim strback, strtext string
strtext = txtinvoer.text intlength = txtinvoer.text.length intlength = 1 intlength lblletterperletter.text &= strtext.substring(0, intlength) & vbcrlf next intteller = 0 strtext.length - 1 lblondermekaar.text &= strtext.chars(intteller).tostring next
how display let's name under eachoter? ex.
s
h
a
w
n
you can utilize string.join
:
lblletterperletter.text = string.join(environment.newline, "shawn".asenumerable())
you need utilize asenumerable()
treat string
ienumerable(of char)
, otherwise it's treated single string
. declare ienumerable(of char)
in first place:
dim namechars ienumerable(of char) = "shawn" lblletterperletter.text = string.join(environment.newline, namechars)
vb.net string
Comments
Post a Comment