Re: String.IndexOf

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 08/03/04


Date: Tue, 3 Aug 2004 18:38:19 +0100

BobTheHacker <BobTheHacker@discussions.microsoft.com> wrote:
> For some reason my index of is not finding my string. If I understand
> correctly my code below should upper case the string being searched
> (within an internal buffer), upper case the string to find and return
> the index value. Well it is finding the last occurence and skipping
> the first occurence. Is there something I am not understanding
> correctly?
>
> icnt = strBuffer.ToLower().IndexOf(strOuterTag.ToLower());
>
> I am searching for <OUTSPEC> and the first occurence in the string is
> <outspec>.

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


Relevant Pages

  • Re: Sor 4 and 6
    ... as if they were a string of beads. ... even though they are in the upper part.. ... There is a recording of Ypes ...
    (rec.music.classical.guitar)
  • Re: How to use the UNIX command: tr
    ... > "Does anyone know how to convert a lower case string to upper case ... > Which ignores the OPs question, even though the poster is obviously ... I'm sorry, that is my response, taken out of context. ...
    (comp.unix.solaris)
  • Re: How to use the UNIX command: tr
    ... > I know very well they are POSIX compliant keywords. ... "Does anyone know how to convert a lower case string to upper case ... Which ignores the OPs question, even though the poster is obviously ...
    (comp.unix.solaris)
  • How to add a string to a big file in csharp !
    ... I want to add a string to the file and the file is sort by letter! ... string str = sr.ReadLine; ... long upper = fs.Length - 1; ... the FileStream is fitable in it? ...
    (microsoft.public.dotnet.languages.csharp)
  • How to add a string to a big file in csharp !
    ... want to add a string to the file and the file is sort by letter! ... Just after "cabbage" and at the front ... string str = sr.ReadLine; ... long upper = fs.Length - 1; ...
    (microsoft.public.dotnet.general)