Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ngx-string-helper

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-string-helper

Just a simple lightweight Angular 2+ string helper.

  • 2.0.6
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Angular 2+ String Helper

Just a simple lightweight Angular 2+ string helper

Installation

Install via npm

$ npm i ngx-string-helper --save

NPM

API Usage

        To use it in your Angular 2 app import the module in your root module(app.module.ts) as shown below.

        import { NgxStringHelperModule } from 'ngx-string-helper';
        ...
        ...
        @NgModule({

        imports:[
                NgxStringHelperModule
        ],

        })

        In your components simply import the service.

        import { NgxStringHelper } from 'ngx-string-helper';
        ...
        ...
        export class YOUR_MODULE {

                constructor(private ngxStringHelper: NgxStringHelper) {

                        console.log(ngxStringHelper.isNullOrEmpty(''));

                }

        }
NgxStringHelper.isNullOrEmpty();
        let sampleString = "This is a sample string";
        let isNullOrEmpty = ngxStringHelper.isNullOrEmpty(sampleString);
        console.log(isNullOrEmpty); //Outputs: True
NgxStringHelper.contains();
        //returns true
        if (Str.contains('this is a sample string', 'sample')) {
            //Do something awesome here..
        }
NgxStringHelper.truncate();
        var sampleString = "This is a sample string";
        var str = Str.truncate(sampleString, 9);
        console.log(str); //Outputs: This is a...
Thanks and enjoy!

Keywords

FAQs

Package last updated on 16 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc