Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VB-Catching first 4 characters in textbox

I am currently working on a really basic scripting langauge (called EngineScript) that gets the first 4 letters of a textbox's content (in a Windows Form project) and compares it to a in-program list of keywords and then uses the remaining characters to form an argument to the keywords... I was wondering weather you had some code ideas on how to go about placing the first 4 letters in one variable and then the remaining characters into another. My langauge will be single command.. i.e you will only be able to run one command per program.

like image 287
Vladimar Chudnofski Avatar asked Dec 26 '22 04:12

Vladimar Chudnofski


1 Answers

String.Substring() should work:

Dim first4Chars = TextBox1.Text.Substring(0, 4)
Dim restOfChars = TextBox1.Text.Substring(4)
like image 75
Andy Avatar answered Jan 10 '23 18:01

Andy