-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
StringMethods should have the same methods as standard str #9111
Comments
Added |
Would like to discuss an additional:
|
The last remaining is CC @mortada |
@sinhrks that sounds reasonable. I'm happy to do a PR for this. |
Thanks, @mortada ! |
Should
StringMethods
be compatible with standardstr
, or have only useful methods? Sometimes I have to adjust text formats before converting other types, and I've chosen additionals which makes formatting / adjustments easier. Any ideas?str.find
(ENH: Add StringMethod.find and rfind #9386)str.rfind
(ENH: Add StringMethod.find and rfind #9386)str.isalnum
(ENH: StringMethods supports is_xxx methods #9282)str.isalpha
(ENH: StringMethods supports is_xxx methods #9282)str.isdigit
(ENH: StringMethods supports is_xxx methods #9282)str.isspace
(ENH: StringMethods supports is_xxx methods #9282)str.islower
(ENH: StringMethods supports is_xxx methods #9282)str.isupper
(ENH: StringMethods supports is_xxx methods #9282)str.istitle
(ENH: StringMethods supports is_xxx methods #9282)str.ljust
(ENH: StringMethods now supports ljust and rjust #9352)str.rjust
(ENH: StringMethods now supports ljust and rjust #9352):StringMethods.pad
works as the same asljust
,rjust
andcenter
by switchingside
option. AndStringMethods.center
exists,ljust
andrjust
don't.str.rsplit
:split
also supports regex, and there seems no straightforward way torsplit
using regex. (ENH: added rsplit to StringMethods #10303)str.zfill
(ENH: Add StringMethods.zfill #9387)StringMethods.center
andStringMethods.pad
should have 'fillchar` kw to specify padding character. (ENH: StringMethods now supports ljust and rjust #9352)str.capitalize
(ENH: Add StringMethods.capitalize and swapcase #9766)str.swapcase
(ENH: Add StringMethods.capitalize and swapcase #9766)str.translate
(ENH: support str translate for StringMethods #10052)str.index
(ENH: support StringMethods index and rindex #10045)str.rindex
(ENH: support StringMethods index and rindex #10045)str.partition
(ENH: Add StringMethods.partition and rpartition #9773)str.rpartition
(ENH: Add StringMethods.partition and rpartition #9773)unicode.isnumeric
(ENH: Add StringMethods.isnumeric and isdecimal #9439)unicode.isdecimal
(ENH: Add StringMethods.isnumeric and isdecimal #9439)unicodedata.normalize
(ENH: Added str.normalize to use unicodedata.normalize #10031)NOTE For python 2.x, once convert target to unicode internally then call the func.
Which may not be very userful:
expandtabs
splitlines
I think there is an option to implement these to say "support the same methods as standard
str
".The text was updated successfully, but these errors were encountered: