Skip to content
You can use easy String Methods
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
src
vendor
README.md
composer.json

README.md

String-Helper

You can use easy String Methods

Install

composer require majoreasy/stringhelper

Usage

require_once('vendor/autoload.php'); use \Major\Helper\StrHelper;

  • toJadenCase

echo StrHelper::setStr("hi i like tea")::toJadenCase();
// Hi I Like Tea

  • Repeat

echo StrHelper::setStr("Hello my name is James")::repeat(3);
// Result : Hello my name is James Hello my name is James Hello my name is James

  • Slice

echo StrHelper::setStr("Im from England")::slice(0, 3);
// Result : Im

  • Length

echo StrHelper::setStr("I have brother")::length();
// Result : 14

  • toUpperCase

echo StrHelper::setStr("This is my message")::toUpperCase();
// Result : THIS IS MY MESSAGE

  • toLowerCase

echo StrHelper::setStr("and I have Smart Phone")::toLowerCase();
// Result : and i have smart phone

  • toASCII echo StrHelper::setStr("H")::toASCII();
    // Result : 72

  • Replace

echo StrHelper::setStr("Hi my name is murat")::replace("murat", "james");
// Result : Hi my name is james

  • includes

echo StrHelper::setStr("Hi im living italy")::includes("italy");
// Result :1

  • endsWith

echo StrHelper::setStr("Hi im living sweden")::endsWith("sweden");
// Result :1

  • startsWith

echo StrHelper::setStr("Hi im living sweden")::startsWith("Hi");
// Result :1

You can’t perform that action at this time.