My question is basically how I can separate a string using a delimiter. In my case what I did was split it using a split, let's say the chain will contain the following:
ADELIMITADORB
But what I get by separating it is DELIMITADORB
when what I wanted to get was A Y B
. Result I get:
Source:
using System;
namespace Consol
{
class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World!");
// TODO: Implement Functionality Here
//obtenemos la string
string str = "AdelimitadorB";
char[] delimiterChars = { 'D', 'E', 'L', 'I', 'M' , 'I', 'T', 'A', 'D', 'O', 'R'};
string[] arr = str.Split(delimiterChars);
string a = arr[0];
string b = arr[1];
Console.Write(b);
Console.ReadKey(true);
}
}
}
How you could do to get A Y B
separately using the DELIMITADOR
delimiter.