C# Syntax - Split String into Array by Comma, Convert To Generic List, and Reverse Order

后端 未结 6 576
Happy的楠姐
Happy的楠姐 2020-12-07 19:49

What is the correct syntax for this:

IList names = \"Tom,Scott,Bob\".Split(\',\').ToList().Reverse();

What am I

6条回答
  •  醉梦人生
    2020-12-07 20:32

    Try this:

    List names = new List("Tom,Scott,Bob".Split(','));
    names.Reverse();
    

提交回复
热议问题