How to use split in C # (separate data separated by specific symbols)

Source: Internet
Author: User
Recently, in the group column of Dapeng network, I thought of two methods to implement group members,
The first method is to create a group member database and add a new member to add a piece of data. However, if so, the database data size of the group members will be huge. Assume that each group has 10000 members, if there are 1000 groups, the data volume will reach 10000000,
The second method is to create a database for group members, including the field ID, group ID, and group members. The group members are the fields for storing the member IDs, separated by commas, separate the usernames using the split method during reading and add them to the datalist control of the displayed data. In this way, the data volume will be greatly reduced.

Implementation example:
String userid = "yzwdli, yzwdli1, yzwdli2, yzwdli3"
User = userid. Split (",");
For (I = 0; I <user. length; I ++)
{
User [I]
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.