Jump to content
Sign in to follow this  

Counting occurances of a substring in a string

Recommended Posts

Ok, I found a way to store data in my newegg computer builder, however I need a way to find how many times a substring is found is string in order to find out how many items are in each group. I tried making my own function for it, but it doesn't seem to work (always returns 1)


Edited by mblunk

Share this post

Link to post
Share on other sites

$text = StringReplace("this is a line of text", " ", "-")
$numreplacements = @extended
MsgBox(0, "New string is", $text)
MsgBox(0, "The number of replacements done was", $numreplacements)

@Extended is your answer, you do not need to "change or replace" the actual info


Oh, thanks. I thought there was probably something already built-in, and I thought I remembered seeing it before, but I couldn't find it after a few minutes of searching in the help so I posted here. Thanks again.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...