All Projects → danielpclark → Mightystring

danielpclark / Mightystring

Licence: mit
Making Ruby Strings Powerful

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Mightystring

Util
A collection of useful utility functions
Stars: ✭ 201 (+617.86%)
Mutual labels:  string, strings, string-manipulation
Cracking The Coding Interview
Solutions for Cracking the Coding Interview - 6th Edition
Stars: ✭ 35 (+25%)
Mutual labels:  string, strings, string-manipulation
Twine
String manipulation, leveled up!
Stars: ✭ 496 (+1671.43%)
Mutual labels:  strings, string-manipulation
normalize-text
📝 Provides a simple API to normalize texts, whitespaces, paragraphs & diacritics.
Stars: ✭ 54 (+92.86%)
Mutual labels:  string, string-manipulation
StringPool
A performant and memory efficient storage for immutable strings with C++17. Supports all standard char types: char, wchar_t, char16_t, char32_t and C++20's char8_t.
Stars: ✭ 19 (-32.14%)
Mutual labels:  string, strings
the-stringler
An OOP approach to string manipulation.
Stars: ✭ 36 (+28.57%)
Mutual labels:  strings, string-manipulation
string theory
Flexible modern C++ string library with type-safe formatting
Stars: ✭ 32 (+14.29%)
Mutual labels:  strings, string-manipulation
tplv
👣 Nano string template library for modern, based on ES6 template string syntax.
Stars: ✭ 31 (+10.71%)
Mutual labels:  string, strings
vbml
Way to check, match and resist.
Stars: ✭ 27 (-3.57%)
Mutual labels:  string, string-manipulation
Cuerdas
String manipulation library for Clojure(Script)
Stars: ✭ 272 (+871.43%)
Mutual labels:  strings, string-manipulation
indexed-string-variation
Experimental JavaScript module to generate all possible variations of strings over an alphabet using an n-ary virtual tree
Stars: ✭ 16 (-42.86%)
Mutual labels:  string, strings
Chr
🔤 Lightweight R package for manipulating [string] characters
Stars: ✭ 18 (-35.71%)
Mutual labels:  strings, string-manipulation
Libft
42 library of basic C functions - queues, lists, memory operations and more 😄
Stars: ✭ 21 (-25%)
Mutual labels:  strings, string-manipulation
bigint
bigint is a C++ library which can handle Very very Big Integers. It can calculate factorial of 1000000... it can go any big. It may be useful in Competitive Coding and Scientific Calculations which deals with very very large Integers. It can also be used in Decryption process. It has many inbuilt functions which can be very useful.
Stars: ✭ 34 (+21.43%)
Mutual labels:  strings, string-manipulation
split-on-first
Split a string on the first occurrence of a given separator
Stars: ✭ 68 (+142.86%)
Mutual labels:  string, string-manipulation
node-red-contrib-string
Provides a string manipulation node with a chainable UI based on the concise and lightweight stringjs.com.
Stars: ✭ 15 (-46.43%)
Mutual labels:  string, string-manipulation
stringext
Extra string functions for OCaml
Stars: ✭ 20 (-28.57%)
Mutual labels:  string, string-manipulation
Portable Utf8
🉑 Portable UTF-8 library - performance optimized (unicode) string functions for php.
Stars: ✭ 405 (+1346.43%)
Mutual labels:  string, string-manipulation
Stringsimilarity.net
A .NET port of java-string-similarity
Stars: ✭ 242 (+764.29%)
Mutual labels:  string, strings
python-string-utils
A handy Python library to validate, manipulate and generate strings
Stars: ✭ 47 (+67.86%)
Mutual labels:  strings, string-manipulation

MightyString

Gem Version Build Status

Powerful methods for your strings.

Install

Add this to your Gemfile and then run bundle install.

gem 'mightystring', '~> 1.0'

Or you can just install and use it manually.

gem install mightystring

Usage

# String#at
"abc".at(0)
# => "a"
"0123456789".at(-1)
# => "9"
"vwq".at(5)
# => nil

# String#del
"asdfasdf".del(0..2)
# => "fasdf"
"asdfasdf".del(1)
# => "adfasdf"
"asdfasdf".del([1,3])
# => "adasdf"
"asdfasdf".del("a")
# => "sdfsdf"

# String#del!
str = "asdfasdf"
str.del!("sd")
str
# => "afaf"
str.del!(1..2)
str
# => "af"

# String#first
"asdf".first
# => "a"

# String#last
"asdf".last
# => "f"

# String#pop
"asdf".pop
# => "f"

# String#push
"asdf".push("r")
# => "asdfr"

# String#shift
"asdf".shift
# => "a"

# String#sort
str = "asdf"
str.sort
# => "adfs"
str
# => "asdf"

# String#sort!
str = "asdf"
str.sort!
# => "adfs"
str
# => "adfs"

# String#unshift
"asdf".unshift("r")
# => "rasdf"

# String#values_at
"asdfasdfasdf".values_at(0,5,-1)
# => ["a", "s", "f"]

# String#index_all
"012324507654301243".index_all( "0" )
# => [0,7,13]
"the apple is the best fruit in the world".index_all( "the" )
# => [0, 13, 31]
"asdfasdfasdf".index_all( /sd/ )
# => [1,5,9]

# String#sift
"qwertyuiop".sift( "aeiou" )
# => "euio"
"qa2ws3ed4rf5tg6yh7uj8ik9ol".sift( Range.new( "0", "9" ) )
# => "23456789"

# String#head
"asdf".head
# => "a"
"asdf".head(3)
# => "asd"

# String#tail
"asdf".tail
# => "sdf"
"asdf".tail(3)
# => "f"

# String#bhead and String#bisect_head
"asdf".bhead
# => ["a", "sdf"]
"asdf".bhead(3)
# => ["asd", "f"]

# String#btail and String#bisect_tail
"asdf".btail
# => ["sdf", "a"]
"asdf".btail(3)
# => ["f", "asd"]

Extras

  • MightyString::HTML.text provides a more ideal HTML to ASCII formatting output. This is an advanced block "filtering" module. It works very well with, currently, extremely rare cases that fall through it's fingers. Regardless it's beautiful, and will strive to be more so.

Look at the test/mightystring_test.rb for case usages of each feature.

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].