Code Monkey home page Code Monkey logo

strong's Introduction

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

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, or documentation for, strong's features, take a look at the wiki. Over there you can find the function reference, and documentation for string indexing and the operators.

Example

A quick example of a few of the features.

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

for line in s:lines() do
  for _, s in pairs(line / ' ')
    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.
  • kikito provided a much better implementation of squeeze.
  • TsT helped to improve and fix the split function and added the modulo operator.
  • Roland Yonaba provided the solution to a problem with a couple special pattern characters.

strong's People

Contributors

kikito avatar starius avatar tst2005 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

strong's Issues

sugestion: trim functions

Hi, you lib are impresive.

add:
rtrim (right trim)
ltrim (left trim)
trim (both)
left and right justification

Doesnt work on UTF-8

require 'strong'

function love.draw()
	s = 'läla'
	love.graphics.print(s(4), 10, 10)
end

Gives "l", not 'a' which would be the fourth letter. s(3) even fails with "UTF-8 decoding error: Invalid UTF-8".

Is strong not made for international strings?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.