| |

VerySource

 Forgot password?
 Register
Search
View: 1557|Reply: 11

Ask a weak question: List

[Copy link]

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-2-14 19:00:01
| Show all posts |Read mode
List <T>
What exactly does this thing mean and what is its use? I often see methods written like this
public List <string> CutWord (string str)
{
 
}
There are other same methods, all have this: <>.
Don't understand
Please tell me more about it
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-4-13 16:15:01
| Show all posts
Verysource submitted a problem today, which caused me to submit it twice,
But there are points
Reply

Use magic Report

0

Threads

58

Posts

32.00

Credits

Newbie

Rank: 1

Credits
32.00

 China

Post time: 2020-5-8 20:30:01
| Show all posts
Simply put, all the strings in the list must be strings
Reply

Use magic Report

0

Threads

29

Posts

23.00

Credits

Newbie

Rank: 1

Credits
23.00

 China

Post time: 2020-5-9 02:00:01
| Show all posts
Is it equivalent to an array?
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-5-10 14:15:01
| Show all posts
Generics, I also do n’t understand this stuff, I used a lot of generics in this last project
I did n’t write it.
I don't quite understand generics yet.
Reply

Use magic Report

1

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-5-12 11:15:01
| Show all posts
Simply speaking:

List <T> is equivalent to a collection of objects, the common situation is: the bonding of controls such as Gridview
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-6-22 15:00:01
| Show all posts
Everyone says something different
Who should listen to
------------------------
Simply put, all the strings in the list must be strings
------------------------
This sounds very simple

What is generic, I will look at the information
Reply

Use magic Report

0

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 Invalid IP Address

Post time: 2020-6-23 19:15:01
| Show all posts
The C++ template indicates that there is a linked list, and each element is of type string. If the parameter is int, then each element is of type int.
It is recommended to look at the usage of templates
Reply

Use magic Report

1

Threads

18

Posts

14.00

Credits

Newbie

Rank: 1

Credits
14.00

 China

Post time: 2020-6-25 21:15:02
| Show all posts
The generic usage of C# can be List<int> List<char>...
<>You can put any type inside, similar to the template in C++, which means a string type list
Reply

Use magic Report

0

Threads

119

Posts

67.00

Credits

Newbie

Rank: 1

Credits
67.00

 China

Post time: 2020-6-25 22:30:01
| Show all posts
Generic usage of C#
List is a list, <> is the type you want to add to this list
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list