Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# split string after each # symbol [duplicate]

Tags:

string

c#

split

i was wondering is there's only one way ( regex ) to split string after each # symbol here's how looks result, which i want to split in string variables 27173316#sometext.balbalblabba#4849489#text#text2#number I want to past each value before # in string variable or array

like image 491
dovydas juraska Avatar asked Nov 19 '12 19:11

dovydas juraska


1 Answers

You can just use String.Split:

string input = "27173316#sometext.balbalblabba#4849489#text#text2#number";
string[] values = input.Split('#');
like image 80
Reed Copsey Avatar answered Oct 30 '22 23:10

Reed Copsey