hello again,
i need help in concatening string <001089< :122003396: 3240058971<
and the should be like
numbe1=001089
number2=122003396
number3=3240058971
guyz help me plzzz.
thanks n regrds
kumar
hello again,
i need help in concatening string <001089< :122003396: 3240058971<
and the should be like
numbe1=001089
number2=122003396
number3=3240058971
guyz help me plzzz.
thanks n regrds
kumar
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
s kumarPosted Nov 22, 2007, 7:04 AM
hello guyz,
i am sorry guyz i really meant string parsing. thanks for ur support. especially thanks to Alan
AlanPosted Nov 22, 2007, 4:51 AM
Judging by his previous thread, I think Kumar is in fact talking here about string parsing ( breaking it up) as opposed to concatenation (putting it together).
If that's the case, then this code should do it:
using System;
class Test
{
static void Main()
{
string s = "<001089< :122003396: 3240058971<";
s = s.Replace("<","").Replace(" ","");
string[] sa = s.Split(':');
for(int i = 0; i < sa.Length; i++)
{
Console.WriteLine("Number{0}={1}", i+1, sa[i]);
}
Console.ReadKey();
}
}
Al MamunPosted Nov 22, 2007, 3:14 AM
In C# it is very easy to concate strings using "+" operator.
if there is or are problem(s) then use "()" and then use "+";
for example:
string n1="125000";
string n2="230222";
string n3="Hello";
string n4 = (n1+n2)+n3;
Best Regards,
Abdullah Al Mamun