String#LastIndexOf

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mathias Weyel

    String#LastIndexOf

    Hi Group!

    I encounter a strange behaviour of String.LastInde xOf when specifying
    start and count values.

    The following works:

    string tempString = orgString.SubSt ring(0, mycount);
    int index = tempString.Last IndexOf(mychar) ;

    The following causes an ArgumentOutOfRa ngeException:

    int index = orgString.LastI ndexOf(mychar, 0, mycount);

    Values at the time of execution:

    mychar: '<'
    orgString.Lengt h: 6347
    mycount: 663

    Is this a known issue (Framework version 2.0)?

    cheers

    Mathias
  • Jon Skeet [C# MVP]

    #2
    Re: String#LastInde xOf

    On Feb 13, 11:37 am, Mathias Weyel <n...@josquin.o rgwrote:

    <snip>
    I'd be glad if you could, I have never done so before and currently have
    no time digging through the pages to file an appropriate report.
    Well, I'm not exactly flush with time myself - but I'll file it :)

    Jon

    Comment

    • Mathias Weyel

      #3
      Re: String#LastInde xOf

      Jon Skeet [C# MVP] schrieb:
      On Feb 13, 11:37 am, Mathias Weyel <n...@josquin.o rgwrote:
      >
      <snip>
      >
      >I'd be glad if you could, I have never done so before and currently have
      >no time digging through the pages to file an appropriate report.
      >
      Well, I'm not exactly flush with time myself - but I'll file it :)
      >
      Jon
      Well, at least you know how to do properly in the sense of where to put
      what information how.
      I've had enough badly formed error reports to be somewhat careful about
      these things.

      I'll tell you as soon as I have had a chance to look into it myself,
      then I can file one for you in return. :)

      Mathias

      Comment

      • Jon Skeet [C# MVP]

        #4
        Re: String#LastInde xOf

        On Feb 13, 2:08 pm, Mathias Weyel <n...@josquin.o rgwrote:
        Well, at least you know how to do properly in the sense of where to put
        what information how.
        I've had enough badly formed error reports to be somewhat careful about
        these things.
        :)
        I'll tell you as soon as I have had a chance to look into it myself,
        then I can file one for you in return. :)
        Fair enough :)

        If you're interested in see what I've filed, here's the URL:



        Jon

        Comment

        Working...