mike <sp******@hotmail.com> wrote:
In my array i have 10|5.98
string[] mySplit = myArray.Split('|');
string DeliveryAddress = mySplit[0];
string ShippingID = mySplit[1];
my problem is ShippingID contains 5.9 not 5.98
can anyone tell me where my last number has gone, or how i get around this
problem?
I suspect your problem doesn't lie where you think it does.
Could you post a short but complete program which demonstrates the
problem?
See
http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.
Here's a short but complete example which *doesn't* show the problem -
it shows Split working perfectly well:
using System;
class Test
{
static void Main()
{
string myArray = "10|5.98";
string[] mySplit = myArray.Split('|');
string DeliveryAddress = mySplit[0];
string ShippingID = mySplit[1];
Console.WriteLine(DeliveryAddress);
Console.WriteLine(ShippingID);
}
}
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too