-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(stdlib): add new functions in std/text
#373
Conversation
- `reverse`: reverses the given text. - `is_prefix`: checks if a string is a prefix of another string. - `is_suffix`: checks if a string is a suffix of another string. These addition of `is_prefix` & `is_suffix` complement the existing `contains` function.
I would prefer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i agree with @Mte90, it should be named startswith
and endswith
to be more intuitive
the code is good tho, i pulled it and tested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change is_suffix/is_prefix as suggest in the PR and we can merge it :-)
shouldn't we use |
Indeed it is better! |
is_prefix -> starts_with is_suffix -> ends_with
51ce178
to
fa15f13
Compare
updated but i think there is something wrong with the |
* feat(stdlib): add new functions in `std/text` - `reverse`: reverses the given text. - `is_prefix`: checks if a string is a prefix of another string. - `is_suffix`: checks if a string is a suffix of another string. These addition of `is_prefix` & `is_suffix` complement the existing `contains` function. * refactor: change `is_prefix` & `is_suffix` function names is_prefix -> starts_with is_suffix -> ends_with
reverse
: reverses the given text.starts_with
: checks if a string is a prefix of another string.ends_with
: checks if a string is a suffix of another string.The addition of
starts_with
&ends_with
complement the existingcontains
function.