c# - converting a list of string to integers starting at 0 to 1 to -
i wondering how convert these lists of unknowing strings list of integers, starting @ 0, 1, 2, , forth, , in collaboration of google sheets api. here circumstances: credits sheets api overview page google, have this
foreach (spreadsheetentry entry in feed.entries) { // print title of spreadsheet screen console.writeline(entry.title.text); }
now instead of wanting debug strings of retrieved list off of google spreadsheets, want convert values/integers, work chunk:
spreadsheetentry spreadsheet2 = (spreadsheetentry)feed.entries[the solution code above];
thanks reading guys! :)
for example lets imagine have want populate list<string> , list<int> or list<object>
values , want avoid populating list using loop or foreach loop can following 1st
example populate list dynamic empty string array {}`
string[] bargearr = { }; var bargelist = new list<string> { "ticketid", "refno", "movetype", "measurementtype" }; bargearr = bargelist.toarray();//use debugger see list has strings
2nd
example create list<object>
string, int, , collection
bargearr = bargelist.toarray(); var bargelist2 = new list<object> { "sirsirx", 1, new list<string>{"conal", "moneybags"}, "measurementtype" }; var bargearr2 = bargelist2.toarray();//notice list<object> holds different data types
now can mess around , same thing if did following store values in list loop
list<int> someintlist = new list<int>(); (var intcount = 0; intcount < 10; intcount++) { someintlist.add(intcount); }
your list populated values 0 9
Comments
Post a Comment