Alternative to using MatchCollections
- From: TheReckter@xxxxxxxxx
- Date: 7 Oct 2006 17:46:52 -0700
The following method does not seem to work because MatchCollections are
read only, does anyone know another way I could accomplish a simillar
thing, this would be greatly appreciated, thankyou.
char[] RandSymbols = new char[] { '!', '@', '#', '$', '%', '^',
'&', '*', ':', ';' };
private void FuncRand()
{
Random R = new Random();
Regex RegSymbol = new Regex(@"\[s\]");
string main = Main.Text;
int[] Buff = new int[50];
int x = 0;
int i = 0;
switch (x)
{
case 0:
MatchCollection SymReg =
RegSymbol.Matches(main);
i = 0;
while (i < 50)
{
Buff[i] = R.Next(0, 10);
i++;
}
i = 0;
foreach (Match Match in SymReg)
{
Match.Value.Replace("[s]",
Buff[i].ToString());
i++;
}
textBox1.Text = main;
break;
}
i = 0;
x++;
}
}
.
- Follow-Ups:
- Re: Alternative to using MatchCollections
- From: Kevin Spencer
- Re: Alternative to using MatchCollections
- From: Marc Gravell
- Re: Alternative to using MatchCollections
- Prev by Date: Re: How close/open forms in Windows app?
- Next by Date: Re: How close/open forms in Windows app?
- Previous by thread: How close/open forms in Windows app?
- Next by thread: Re: Alternative to using MatchCollections
- Index(es):