Resolved String Array and Split; I'm doing something wrong..

Program4Food

Active member
Joined
Nov 22, 2021
Messages
40
Programming Experience
10+
I am obviously still learning syntax, things are a little different in C# than in VB.

I am doing this to learn the concepts, so my code is broke down in baby steps so I can mentally keep track of what I am doing.

Anyway, I think I am close, but the way I am trying to do it generates debug errors, I may not be fully understanding enough to
figure out what I am doing wrong... I have as always been using Google as my first resource before just jumping here..

<bow>As always, I thank you for your valuable time and knowledge <\bow>


1638507859136.png
 
Solution
*I FIGURED IT OUT!!*

The brackets are only used when the string is defined indicating it is an array or fetching array values, NOT when setting it's value,
I also got rid of the { } brackets which were in some sample code from Google search and that took care of that..





1638509362676.png







Functions fine! In spite of the spaghetti code.. :-/


1638509500298.png
*I FIGURED IT OUT!!*

The brackets are only used when the string is defined indicating it is an array or fetching array values, NOT when setting it's value,
I also got rid of the { } brackets which were in some sample code from Google search and that took care of that..





1638509362676.png







Functions fine! In spite of the spaghetti code.. :-/


1638509500298.png
 
Solution
The brackets are only used when the string is defined indicating it is an array or fetching array values, NOT when setting it's value
The brackets are used when specifying an array type, e.g. declaring a variable, method parameter or the like. Other than that, an array variable is exactly like any other variable, so getting or setting the value of the variable is just like any other variable, i.e. no brackets. You do use brackets to index the array object when getting or setting an element of that array.
 
For future reference, please don't post just pictures of code. Post a screenshot if it adds value but ALWAYS post the code as text, formatted as code. That enables us to copy it if we want to test it for ourselves, repost an edited version. or whatever. The same goes for error messages, because we may want to copy them to post into a search engine. Pictures can also be difficult to view on a mobile device.
 
Back
Top Bottom