Skip to content

Instantly share code, notes, and snippets.

@ouzdev
Created December 15, 2019 10:05
Show Gist options
  • Save ouzdev/dcd5b68ce85410d37c77d1c83d9a9f5a to your computer and use it in GitHub Desktop.
Save ouzdev/dcd5b68ce85410d37c77d1c83d9a9f5a to your computer and use it in GitHub Desktop.
C# segment text by special character
list.Add(text);
string temporary = "";
string main_text = "";
foreach (string item in list)
{
for (int i = 0; i < item.Length; i++)
{
temporary = item[i].ToString();
metin_tam = main_text + temporary;
if (gecici == character) //parameter
{
list_tam.Add(metin_tam.Substring(0, metin_tam.Length - 1));
metin_tam = "";
}
gecici = "";
}
listBox1.Items.Add(metin_tam);
for (int i = 0; i < liste_tam.Count; i++)
{
listBox1.Items.Add(liste_tam[i]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment