Skip to content

Instantly share code, notes, and snippets.

@jskeet
Created December 7, 2018 08:02
Show Gist options
  • Save jskeet/873ac0b69a2cd3e607a054ecf318cbba to your computer and use it in GitHub Desktop.
Save jskeet/873ac0b69a2cd3e607a054ecf318cbba to your computer and use it in GitHub Desktop.
using System;
public class Program
{
public static void Main()
{
string text = "0|aaaaaa|aaaaaaaaaaa|aaaaaaaaaa|123456|0|0";
string[] parts = text.Split(new char[] { '|' });
for (int i = 0; i < parts.Length; i++)
{
Console.WriteLine($"{i}: {parts[i]}");
}
if (parts[0].Equals("0"))
{
if (parts[6].Equals("0"))
{
Console.WriteLine("This is not date");
}
else
{
Console.WriteLine($"This is date: {parts[6]}");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment