Nanometers Per Millisecond

    substring-getter

    0.1.0 • Public • Published

    subString-getter

    Get some substrings with special requirements, for example, the longest repeating substring, the longest non-repeating substring, etc.

    Install

    $ npm install --save substring-getter
    

    Usage

    .getLgstNonRepeatSubStr

    Returns the longest substring of a non-repeating character in a string. When there are two strings of the same length, the first longest substring of the character is output.

    Params

    • String
    var subStringGetter = require('substring-getter');
     
    var input = "substring@chengbo";
     
    subStringGetter.getLgstNonRepeatSubStr(input);
    //ubstring@che
    var subStringGetter = require('substring-getter');
     
    var input = "substring-getter||programmer";
     
    subStringGetter.getLgstNonRepeatSubStr(input);
    //ubstring|

    .getLgstRepeatSubStr

    Returns the longest substring of a repeating character in a string. And an empty string is returned without repeating the substring.

    Params

    • String
    var subStringGetter = require('substring-getter');
     
    var input = "substring-getter can quickly get the substring that you need.";
     
    subStringGetter.getLgstRepeatSubStr(input);
    // substring
    var subStringGetter = require('substring-getter');
     
    var input = "ask not what your country can do for you, but what you can do for your country";
     
    subStringGetter.getLgstRepeatSubStr(input);
    // can do for you
    var subStringGetter = require('substring-getter');
     
    var input = "1234qwer";
     
    subStringGetter.getLgstRepeatSubStr(input);
    // ""

    Note

    From version 0.1.0, rename getMaxNonRepeatSubStr to getLgstNonRepeatSubStr.

    Install

    npm i substring-getter

    DownloadsWeekly Downloads

    2

    Version

    0.1.0

    License

    ISC

    Unpacked Size

    7.67 kB

    Total Files

    5

    Last publish

    Collaborators

    • chengbo