Giter VIP home page Giter VIP logo

strman-java's Introduction

strman-java Build Status codecov.io License

A Java 8 library for working with Strings. You can learn about all the String utility functions implemented in strman library by reading the documentation.

Getting Started

To use strman in your application, you have to add strman to your classpath. strman is available on Maven Central so you just need to add dependency in your favorite build tool as shown below.

For Apache Maven users, please add following to your pom.xml.

<dependencies>
    <dependency>
        <groupId>com.shekhargulati</groupId>
        <artifactId>strman</artifactId>
        <version>0.4.0</version>
    </dependency>
</dependencies>

Gradle users can add following to their build.gradle file.

compile(group: 'com.shekhargulati', name: 'strman', version: '0.4.0')

To learn what we added in the latest version please refer to ./changelog.md.

You can refer to Javadocs online http://shekhargulati.github.io/strman-java/.

Inspiration

This library is inspired by dleitee/strman.

License

strman is licensed under the MIT License - see the LICENSE file for details.

strman-java's People

Contributors

cs4r avatar deeseja avatar engfragui avatar lizho avatar shekhargulati avatar szpak avatar vic-nik 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  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  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  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

strman-java's Issues

Possible optimization for isUpperCase and isLowerCase

isUpperCase and isLowerCase currently work by upper or lower casing the input string and comparing.

In my testing, it's a lot faster (and won't create additional strings), if instead you do something like this:

public static boolean isUpperCase(final String value) {
    for (int i = 0; i < value.length(); i++) {
        if (Character.isLowerCase(value.charAt(i))) {
            return false;
        }
    }
    return true;
}

public static boolean isLowerCase(final String value) {
    for (int i = 0; i < value.length(); i++) {
        if (Character.isUpperCase(value.charAt(i))) {
            return false;
        }
    }
    return true;
}

Just an idea. Thanks for the nice library!

removeLeft, replace lowercase return string in case-insensitive call

A useful library, thanks!

removeLeft and replace work in a way I wouldn't expect because they call toLower in the case-insensitive case.

For example,

Strman.removeLeft("This HAS A THIS IN FRONT", "THIS ", false)

returns "has a this in front". I would expect it to return "HAS A THIS IN FRONT".

Perhaps you could check for startsWith in a case-insensitive way, then remove the first N characters of value, where N is the length of prefix.

Strman.replace("One and two and THREE and Four", "and", "&", false)

returns "one & two & three & four". I would expect it to return "One & two & THREE & Four".

I haven't tested this, but maybe for the replace function you could copy the replace function in the String class and specify Pattern.CASE_INSENSITIVE (and maybe Pattern.UNICODE_CASE).

removeRight works in what I would call the correct way:

Strman.removeRight("Remove the END at the end", " END", false)

returns "Remove the END at the".

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.