Re: Problem with string.indexofany
From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 08/24/04
- Next message: Zoury: "HOW TO: Set a DefaultValueAttribute to system color?"
- Previous message: Ignacio Machin \( .NET/ C# MVP \): "Re: C# FileSystemWatcher with multi path"
- In reply to: Systemspecialist: "Problem with string.indexofany"
- Next in thread: Morten Wennevik: "Re: Problem with string.indexofany"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 24 Aug 2004 14:40:30 +0100
Systemspecialist <Systemspecialist@discussions.microsoft.com> wrote:
> I have string where i have to find every character with ASCII code between 0
> and 31. I tried to do this:
> char[] xxx= new char[]
> {Convert.ToChar(00),Convert.ToChar(01),Convert.ToChar(02),Convert.ToC
> har(03),Convert.ToChar(04),Convert.ToChar(05),Convert.ToChar(06),Conve
> rt.ToChar(07),Convert.ToChar(08),Convert.ToChar(09),Convert.ToChar(10)
> ,Convert.ToChar(11),Convert.ToChar(12),Convert.ToChar(13),Convert.ToCh
> ar(14),Convert.ToChar(015),Convert.ToChar(16),Convert.ToChar(17),Conve
> rt.ToChar(18),Convert.ToChar(19),Convert.ToChar(20),Convert.ToChar(21)
> ,Convert.ToChar(22),Convert.ToChar(23),Convert.ToChar(24),Convert.ToC
> har(25),Convert.ToChar(26),Convert.ToChar(27),Convert.T
> oChar(28),Convert.ToChar(29),Convert.ToChar(30),Convert.ToChar(31)};
> text.IndexOfAny(xxx));
>
> but it doesn't work. If i try do this:
>
> char[] xxx= new char[] {'?'}; //? its character for ASCII code 13 (enter)
> this works, but i cannot print ascii code < 10 . Can anybody help me??
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.
-- Jon Skeet - <skeet@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
- Next message: Zoury: "HOW TO: Set a DefaultValueAttribute to system color?"
- Previous message: Ignacio Machin \( .NET/ C# MVP \): "Re: C# FileSystemWatcher with multi path"
- In reply to: Systemspecialist: "Problem with string.indexofany"
- Next in thread: Morten Wennevik: "Re: Problem with string.indexofany"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|