|
-
Mar 5th, 2023, 02:33 AM
#1
Thread Starter
Hyperactive Member
Strings Array? Collection? or List? Which one to use and how?
Hi. Niya, This guy, encouraged me to overcome my embarrassment to post this thread cause It was out of private-message discussion. I might be a bit rusty in VB.NET so please do not judge me.
This thread can be divided in 2 ways of question making:
1) Can you redirect me topic links/snippets/codebank which covers making and working with different types of variables?
I already read Learn.Microsoft I know it is an elementary stuff but I always lack in principles (and also in english).
2) Or answer my questions individually here:
Lets begin with declaring lots of strings you want to add members to them. I saw somewhere
Code:
Dim BunchOfStrings() As String = {}
But there's no .Add or .Insert or something else to add a member.
Meanwhile is this particular way of declaring, it does:
Code:
Private BunchOfStrings As New Collection()
Why it should be private? Why it should be at the beginning right after class definition?
Also in this way:
Code:
Dim names As List(Of String) = {"John", "Mike"}.ToList
you can also add members like
But you may not get the entire list length like before .Length method (or even Len() ).
The goal is to read a CSV file and bypass the "put-them-all-in-a-DGV" stage and put them all in a 1 dimension or even multi dimension string, take its length, call a specific cell/member... Sounds simple at first, nightmare for me.
* I'm cool with different dictations based on different types in VB.NET. I wanna know... I want to learn
* I also want to do these add, remove, length, min, max, etc. supported-built-in functions on Strings, Bytes and maybe other types of variables (which I may deal with soon)
Last edited by pourkascheff; Mar 5th, 2023 at 02:37 AM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|