Re: String method that counts substrings
- From: "Rodrigo Ferreira" <rjrferreira@xxxxxxxxx>
- Date: Wed, 8 Jun 2005 12:42:55 +0100
Use the split method!
If the string was splited 2 times then the substring appears 2 times!
i don't know if this is the best option but, who knows...
"CodeRazor" <CodeRazor@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:48EFF950-4C09-49BE-B1D0-1952AB671314@xxxxxxxxxxxxxxxx
> Is there a string method that allows gives you the number of times a
> substring appears in your string.
>
> Looping through my string performing IndexOf("substring",startPos), seems
> like overkill.
>
> thank you.
> CR
>
>
.
- Follow-Ups:
- Re: String method that counts substrings
- From: Daniel Jin
- Re: String method that counts substrings
- From: CodeRazor
- Re: String method that counts substrings
- References:
- String method that counts substrings
- From: CodeRazor
- String method that counts substrings
- Prev by Date: Re: Windows/forms in a listbox
- Next by Date: C# Override limitation..why?
- Previous by thread: String method that counts substrings
- Next by thread: Re: String method that counts substrings
- Index(es):
Relevant Pages
|