All Projects → huandu → Xstrings

huandu / Xstrings

Licence: mit
Implements string functions widely used in other languages but absent in Go.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Xstrings

Java Ds Algorithms
Data Structures and Algorithms in Java
Stars: ✭ 125 (-85.92%)
Mutual labels:  algorithm, strings
Algorithms
A collection of algorithms and data structures
Stars: ✭ 11,553 (+1201.01%)
Mutual labels:  algorithm, strings
Algorithms Study Group
Study group for algorithms in Ruby, hosted at App Academy
Stars: ✭ 94 (-89.41%)
Mutual labels:  algorithm, strings
Data Structures Algorithms
My implementation of 85+ popular data structures and algorithms and interview questions in Python 3 and C++
Stars: ✭ 273 (-69.26%)
Mutual labels:  algorithm, strings
Pyswarms
A research toolkit for particle swarm optimization in Python
Stars: ✭ 742 (-16.44%)
Mutual labels:  algorithm
Turf
A modular geospatial engine written in JavaScript
Stars: ✭ 6,659 (+649.89%)
Mutual labels:  algorithm
Light Tips
Some code tips about algorithms, php and more 🔥
Stars: ✭ 705 (-20.61%)
Mutual labels:  algorithm
Algorithm interview notes Chinese
学习笔记:自然语言处理(NLP)/深度学习(Deep Learning)/机器学习(Machine Learning)/Python/Pytorch
Stars: ✭ 29 (-96.73%)
Mutual labels:  algorithm
Naive Bayes Classifier
Naive Bayes classifier is classification algorithm. It uses Naive based Bernoulli and Multinomial equation to classify documents(Text) as ham or spam.
Stars: ✭ 6 (-99.32%)
Mutual labels:  algorithm
Competitivequestion
Question solved on various competitive sites 🤘
Stars: ✭ 5 (-99.44%)
Mutual labels:  algorithm
2021 Postgraduate 408
💯✍备考2021年研究生-408
Stars: ✭ 730 (-17.79%)
Mutual labels:  algorithm
Dc Notes
自己的学习笔记。包含:21届秋招经历、🐂客面经问题按照频率总结、Java一系列知识、数据库、分布式、微服务、前端、技术面试、工具教程等(持续更新)
Stars: ✭ 714 (-19.59%)
Mutual labels:  algorithm
Algorithm
Algorithm is a library of tools that is used to create intelligent applications.
Stars: ✭ 787 (-11.37%)
Mutual labels:  algorithm
Texturesynthesis
Texture synthesis from examples
Stars: ✭ 709 (-20.16%)
Mutual labels:  algorithm
Torbot
Dark Web OSINT Tool
Stars: ✭ 821 (-7.55%)
Mutual labels:  algorithm
Tech Refrigerator
🍰 기술 냉장고입니다. 🛒 기술 면접 , 전공 시험 , 지식 함양 등 분명 도움될 거예요! 🤟
Stars: ✭ 699 (-21.28%)
Mutual labels:  algorithm
Imageai
A python library built to empower developers to build applications and systems with self-contained Computer Vision capabilities
Stars: ✭ 6,734 (+658.33%)
Mutual labels:  algorithm
Vscode Leetcode
Solve LeetCode problems in VS Code
Stars: ✭ 6,982 (+686.26%)
Mutual labels:  algorithm
Android Notes
✨✨✨这有一包小鱼干,确定不要吃嘛?( 逃
Stars: ✭ 732 (-17.57%)
Mutual labels:  algorithm
Numerical Computing Is Fun
Learning numerical computing with notebooks for all ages.
Stars: ✭ 730 (-17.79%)
Mutual labels:  algorithm

xstrings

Build Status Go Doc Go Report Coverage Status

Go package xstrings is a collection of string functions, which are widely used in other languages but absent in Go package strings.

All functions are well tested and carefully tuned for performance.

Propose a new function

Please review contributing guideline and create new issue to state why it should be included.

Install

Use go get to install this library.

go get github.com/huandu/xstrings

API document

See GoDoc for full document.

Function list

Go functions have a unique naming style. One, who has experience in other language but new in Go, may have difficulties to find out right string function to use.

Here is a list of functions in strings and xstrings with enough extra information about how to map these functions to their friends in other languages. Hope this list could be helpful for fresh gophers.

Package xstrings functions

Keep this table sorted by Function in ascending order.

Function Friends #
Center str.center in Python; String#center in Ruby #30
Count String#count in Ruby #16
Delete String#delete in Ruby #17
ExpandTabs str.expandtabs in Python #27
FirstRuneToLower lcfirst in PHP or Perl #15
FirstRuneToUpper String#capitalize in Ruby; ucfirst in PHP or Perl #15
Insert String#insert in Ruby #18
LastPartition str.rpartition in Python; String#rpartition in Ruby #19
LeftJustify str.ljust in Python; String#ljust in Ruby #28
Len mb_strlen in PHP #23
Partition str.partition in Python; String#partition in Ruby #10
Reverse String#reverse in Ruby; strrev in PHP; reverse in Perl #7
RightJustify str.rjust in Python; String#rjust in Ruby #29
RuneWidth - #27
Scrub String#scrub in Ruby #20
Shuffle str_shuffle in PHP #13
ShuffleSource str_shuffle in PHP #13
Slice mb_substr in PHP #9
Squeeze String#squeeze in Ruby #11
Successor String#succ or String#next in Ruby #22
SwapCase str.swapcase in Python; String#swapcase in Ruby #12
ToCamelCase String#camelize in RoR #1
ToKebab - #41
ToSnakeCase String#underscore in RoR #1
Translate str.translate in Python; String#tr in Ruby; strtr in PHP; tr/// in Perl #21
Width mb_strwidth in PHP #26
WordCount str_word_count in PHP #14
WordSplit - #14

Package strings functions

Keep this table sorted by Function in ascending order.

Function Friends
Contains String#include? in Ruby
ContainsAny -
ContainsRune -
Count str.count in Python; substr_count in PHP
EqualFold stricmp in PHP; String#casecmp in Ruby
Fields str.split in Python; split in Perl; String#split in Ruby
FieldsFunc -
HasPrefix str.startswith in Python; String#start_with? in Ruby
HasSuffix str.endswith in Python; String#end_with? in Ruby
Index str.index in Python; String#index in Ruby; strpos in PHP; index in Perl
IndexAny -
IndexByte -
IndexFunc -
IndexRune -
Join str.join in Python; Array#join in Ruby; implode in PHP; join in Perl
LastIndex str.rindex in Python; String#rindex; strrpos in PHP; rindex in Perl
LastIndexAny -
LastIndexFunc -
Map String#each_codepoint in Ruby
Repeat operator * in Python and Ruby; str_repeat in PHP
Replace str.replace in Python; String#sub in Ruby; str_replace in PHP
Split str.split in Python; String#split in Ruby; explode in PHP; split in Perl
SplitAfter -
SplitAfterN -
SplitN str.split in Python; String#split in Ruby; explode in PHP; split in Perl
Title str.title in Python
ToLower str.lower in Python; String#downcase in Ruby; strtolower in PHP; lc in Perl
ToLowerSpecial -
ToTitle -
ToTitleSpecial -
ToUpper str.upper in Python; String#upcase in Ruby; strtoupper in PHP; uc in Perl
ToUpperSpecial -
Trim str.strip in Python; String#strip in Ruby; trim in PHP
TrimFunc -
TrimLeft str.lstrip in Python; String#lstrip in Ruby; ltrim in PHP
TrimLeftFunc -
TrimPrefix -
TrimRight str.rstrip in Python; String#rstrip in Ruby; rtrim in PHP
TrimRightFunc -
TrimSpace str.strip in Python; String#strip in Ruby; trim in PHP
TrimSuffix String#chomp in Ruby; chomp in Perl

License

This library is licensed under MIT license. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].