string sNumbers = “1,2,3,4,5”; var numbers = sNumbers.Split(‘,’).Select(Int32.Parse).ToList();
string sNumbers = “1,2,3,4,5”; var numbers = sNumbers.Split(‘,’).Select(Int32.Parse).ToList();
string myValueToSplit = “Istanbul, Tokyo, Seoul, Bangkok, Bali, Minsk, Belgrade, Kiev”; var theFirstValue = myValueToSplit.Split(‘,’)[0]; //OUTPUT: theFirstValue = “Istanbul” //You can change [0] as you wish. //For example, if you want to get Kiev, make it [7]
string_split() is a table-valued function that splits a string into rows of substrings, based on a specified separator character. SELECT * FROM string_split(’21;32;34;47;53;61;’, ‘;’) OUTPUT ====== 21 32 34 47 53 61