Skip to content

Conversation

@mojixcoder
Copy link

@mojixcoder mojixcoder commented Nov 11, 2025

TrimPrefix returns s without the provided leading prefix string. If s doesn't start with prefix, s is returned unchanged.

Here is the function definition:

func TrimPrefix(s, prefix string) string {
	if HasPrefix(s, prefix) {
		return s[len(prefix):]
	}
	return s
}

@MattBrittan
Copy link
Contributor

MattBrittan commented Nov 11, 2025

Thanks, but cannot accept this without an ECA (see the check above, or readme, for more details, yell out if you are having issues signing).

@mojixcoder
Copy link
Author

Thanks, but cannot accept this without an ECA (see the check above, or readme, for more details, yell out if you are having issues signing).

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants