Giter Site home page Giter Site logo

prabeenprabu / stringfunctions Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3 KB

This header file has a functions which are using in javascript.

C++ 100.00%
c-header c-header-file cpp cpp-header cpp-library cpp-programming header javascript-strings string-functions string-manipulation

stringfunctions's Introduction

Hi, I'm Prabeen! ๐Ÿ‘‹

๐Ÿš€ About Me

I'm a developer... I know web development and app development.

๐Ÿ›  Skills

Javascript, HTML, CSS, C++,Java...

๐Ÿ”— Links

instagram

String Functions

This header file has a functions which are only use in java and javascript.

Functions

  • trim()
  • trimStart()
  • trimEnd()
  • indexOf()
  • charAt()
  • capitalize()
  • toLowerCase()
  • toUpperCase()
  • slice()
  • substr()
  • substring()
  • isEndsWith()
  • isStartsWith()

Advantages

  • Save Time
  • Easy to Use

Examples

In this functions we should pass the string as first parameter.

how to include this header file

#include "stringFunctions.h"

trim function

int main(){
  string sample = "   This created by prabeen    ";
  cout << trim(sample);
}

trimStart function

int main(){
  string sample = "   This created by prabeen    ";
  cout << trimStart(sample);
}

trimEnd function

int main(){
  string sample = "   This created by prabeen    ";
  cout << trimEnd(sample);
}

capitalize function

int main(){
  string sample = "   This created by prabeen    ";
  cout << capitalize(sample);
}

toLowerCase function

int main(){
  string sample = "   This created by prabeen    ";
  cout << toLowerCase(sample);
}

toUpperCase function

int main(){
  string sample = "   This created by prabeen    ";
  cout << toUpperCase(sample);
}

substr function

int main(){
  string sample = "   This created by prabeen    ";
  //cout << substr(sample,start_index,end_index);
  cout << substr(sample,3,6);
}

substring function

int main(){
  string sample = "   This created by prabeen    ";
  //cout << substring(sample,start_index,end_index);
  cout << substring(sample,3,6);
}

slice function

int main(){
  string sample = "   This created by prabeen    ";
  //cout << slice(sample,start_index,end_index);
  cout << slice(sample,3,6);
}

charAt function

int main(){
  string sample = "   This created by prabeen    ";
  //cout << charAt(sample,position);
  cout << charAt(sample,7);
}

indexOf function

int main(){
  string sample = "   This created by prabeen    ";
  //cout << indexOf(sample,'char');
  cout << substr(sample,'c';
}

isStartsWith function

int main(){
  string sample = "   This created by prabeen    ";
  //cout << isStartsWith(sample,"t";
  cout << isStartsWith(sample,3,6);
  //this function return value in bool format
}

isEndsWith function

int main(){
  string sample = "   This created by prabeen    ";
  //cout << isEndsWith(sample,"t";
  cout << isEndsWith(sample,3,6);
  //this function return value in bool format
}

stringfunctions's People

Contributors

prabeenprabu avatar

Watchers

 avatar

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.