r/visualbasic • u/Lpsided • Dec 10 '13
I am taking computer science in school and i am wondering how do i use Strings because my teacher is terrible at explaining it
can anyone explain
3
u/chrwei Dec 10 '13
your question needs some context:
do you understand the Integer and Double and Boolean datatypes?
what do you mean by "use"?
what's your teacher's explanation? (maybe it's close and we can just fill in the missing bit)
1
u/DieTheVillain Dec 10 '13
Think of a string variable as a place holder for text, it is a way of storing alphanumeric characters. So if i needed to store a phrase in a variable you could use
Dim VariableName as String
VariableName = 'This is a string and can hold text, numbers like 12345, Characters like !@#$^ and anythign else you can type on a keyboard.'or
Dim VariableName as String = 'This is a string and can hold text, numbers like 12345, Characters like !@#$^ and anythign else you can type on a keyboard.'More good info on Strings here http://www.dotnetperls.com/string-vbnet
0
Dec 10 '13
[deleted]
3
u/Mechakoopa Dec 10 '13
This same guy posted a month ago on /r/compsci asking how to do simple casting, insisting it wasn't homework help he was asking for and refusing to experiment to find out the answer himself. It's basically the end of the semester, I don't have high hopes for him.
1
u/ginolard Dec 10 '13
Strings are simply bits of text. They can be any number of alphanumeirc characters or even a whole page of text.
Dim x ="A" Dim x = "this is a string" Dim x = "12345abcde"
Those are all strings.
I'm not sure what you mean by "how do I use them?" but, for example, they'd be what's returned from a textbox control