Skip to content
This repository was archived by the owner on Mar 16, 2026. It is now read-only.
This repository was archived by the owner on Mar 16, 2026. It is now read-only.

CountMultiX #220

@oldoc63

Description

@oldoc63

Now let change our function to compare against an entire string instead of a single character. This function should accept a string and a substring to compare against. The number of occurrences of the second parameter within the first parameter string are returned. What this means is that we are checking the number of occurrences of the shorter string (second parameter) within the longer string (first parameter). One way to accomplish this is using the split function.

  • Define the function to accept two parameters. word for the input string and x for the second string we are searching for
  • Split the string into substrings based on the second input parameter
  • Count the number of instances the substring appeared in the first input string based on the split string
  • Return the results

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions