Skip to content

Angular library for separating string into prefix, matched and suffix by search matching

Notifications You must be signed in to change notification settings

rizentium/ngx-stringly

Repository files navigation

ngx-stringly

Angular library for separating string into prefix, matched and suffix by search matching

Build Status Coverage Status NPM tag (latest SemVer) GitHub tag (latest SemVer) GitHub

Installation

First, save ngx-stringly to your dependencies.

npm install ngx-stringly --save

Usage

Import ngx-stringly to your component.

import { Searcher } from 'ngx-stringly/ngx';

Use Index in your functions

const text = 'The quick brown fox jumps over the lazy dog.';
const find = 'lazy';

this.result = Searcher.parse(text, find, false);

Result will be

{
  "prefix": "The quick brown fox jumps over the ",
  "content": "lazy",
  "suffix": " dog."
}

Run Example

This example is using angular 7.

Clone the repository

git clone https://github.com/rizentium/ngx-stringly.git

Open example directory

cd example

Install packages

npm install

Run server

ng serve

And navigate your browser to http://localhost:4200