I'm trying to create a program that determines if what i inputted is a Literal (String or a Char)
My idea on how to create one is if i inputted a string (Starts with the usual ") so the first Index in my Array should be " or else it will show invalid same with the last index it should be ".

So my problem is i don't know how. If i input something in a Textbox (Example: Daniweb) my program should automatical determine that an Array has 6 indexes, Can someone help me.

Edited 3 Years Ago by RaoxFaello

Thanks for replying but i have one problem, It's not dynamic.
What if i type something that has larger numbers and letters and the one in the code is fixed it will give me Invalid.

Edited 3 Years Ago by RaoxFaello

Use the Textbox1.Text.Length property.

Any string is basically a character array. You can read the individual characters with an index, Textbox1.Text(0). The last character, without using LINQ, like this, Textbox1.Text(TextBox1.Text.Length-1). With LINQ, TextBox1.Text.Last().

A simple conditional statement to test, If Not(TextBox1.Text(0) = """"c) Or Not(TextBox1.Text(TextBox1.Text.Length-1) = """"c) Then.

Edited 3 Years Ago by tinstaafl

Thank you every much.
I was so fixed on using something more complicated like what i've suggested with the indexes and arrays
whereas i didn't even know there's a Property like that, I really need to read more.

This question has already been answered. Start a new discussion instead.