Skip to content

kikito/strong

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

Strong is a small Lua library that adds a lot of utilities to Lua's string library, and also adds some operators to strings themselves. It is currently at version 1.0.

Strong is based largely on Ruby's String class. I've also taken a few things from thelinx's extensions to strings.

The Name

As you might have guessed, the name "strong" was chosen because it's very close to "string", and because this library makes strings stronger :).

Features/Documentation

To get an idea of strong's features, take a look at the wiki. Over there you can find the documentation for the operators and the function reference. Be warned though, the function reference is still being written.

Example

A quick example of a few of the features.

s = "Hello world.\nBoo. This is cool.\nHey!"

for line in s:lines() do
  local sentences = line / '.%s*'
  
  for _, s in pairs(sentences)
    print(s:capitalize())
  end
end

Tests

The tests are done using telescope. Have a look at the README for that repository to see how to install telescope. Once you've done that, just run tsc spec.lua. Of course if you want to see the results of every test, you can run tsc -f spec.lua.

Contributors

  • Robin Wellner helped to improve performance of insert and also added a couple new abilities to that method.
  • TsT helped to make split have an option to turn on plain text.

About

A Lua library that makes your strings stronger!

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Lua 100.0%