Re: Var type
- From: "Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 2 Dec 2005 10:35:58 -0500
Maarten,
If all you are doing is splitting on the "/", then a regex is overkill
here. Basically, you should use the Split method on the string class, like
so:
string[] s = strvalues.Split(new char[1]{'/'});
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx
"Maarten" <gurkjaan@xxxxxxxxxxx> wrote in message
news:43906830$0$31774$ba620e4c@xxxxxxxxxxxxxxxxx
> HI,
>
> i want to split a variable containing this -----> prog/2
> i want to split on the /
>
> the value is entered in a datagrid, but when i declare the collumn fir
> stringinputs
> i get an error the the inputformat is wrong.
> Regex r = new Regex("(/)");
>
> string[] s = r.Split(strvalues);
>
> MessageBox.Show(s[0]+s[1]);
>
> What is wrong here ?
>
> Regards Maarten
>
>
.
- Follow-Ups:
- Re: Var type
- From: Jon Skeet [C# MVP]
- Re: Var type
- From: Maarten
- Re: Var type
- References:
- Var type
- From: Maarten
- Var type
- Prev by Date: Re: Var type
- Next by Date: calling outside program and getting its handle
- Previous by thread: Re: Var type
- Next by thread: Re: Var type
- Index(es):
Relevant Pages
|