Counting String

Results 1 to 2 of 2

Thread: Counting String

  1. #1
    Join Date
    Dec 1969

    Default Counting String

    How do I count a char in a string<BR>Example:-<BR> countstring("Got a question about Active Server Pages?","s")<BR>and it <BR> return 3 <BR><BR>Thanks<BR>

  2. #2
    Paul Merton Guest

    Default RE: Counting String

    There may be a less processor intensive method, but you could always try doing the following:-<BR><BR>st = "Got a question about Active Server Pages?"<BR>searchChar = "s"<BR>count = len(st) - len(replace(st, searchChar, ""))<BR><BR>Hope that&#039s useful,<BR>paul_merton @

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts