plexis-js / plexis

Lo-fi, powerful, community-driven string manipulation library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: `toSwapCase / swapCase`

vorillaz opened this issue · comments

Swaps lowercase to uppercase and vice versa for the input text.

Example usage

import toSwapCase from '@plexis/to-swap-case';

toSwapCase('Hello WORLD');
// => 'hELLO world'

toSwapCase('123 toys');
// => '123 toys'

Aliases

import toSwapCase from '@plexis/to-swap-case';
import {toSwapCase, swapCase} from 'plexis';

So we dont swap cases if string starts with anything other than a letter?

@Tobenna-KA You can just ignore everything that's not a letter.

commented

This is a good one, brainstorm time!

cool, shouldn't take long

@Tobenna-KA @nowtryz Pull requests are welcome, also if you want any additional feedback or guideline you can take a look at the documentation or even ping me directly.

commented

It is for all char isn't it ? like all of these ?

It is for all char isn't it ? like all of these ?

@nowtryz Yeap :) Hint: instead of matching any single character of all alphabets you can use a regular expression to detect symbols ;)

commented

Yeah, I'm on a good way I think, can I have a complex string to test, please?