Skip to content

imorun/str.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 

Repository files navigation

str.js

Release Downloads
#Download v1.0.6 str.js
English explanation


日本語版

str.jsは、文字列操作を簡単に行える軽量で柔軟なJavaScriptライブラリです。このツールは、文字列のフォーマットを簡単に行うことができるツールです。


主な特徴

  • 🛠️ シンプルで直感的なAPI
  • 🤝 他のJavaScriptライブラリとの互換性が高い
  • 軽量で高速

インストール

以下のリンクからダウンロードしてください:

v1.0.6のstr.jsをダウンロード

また、Gitでクローンすることもできます:

git clone https://github.com/imorun/str.js.git

関数一覧

関数名 説明
str(text) 任意の値を文字列に変換します。
変換前に数値やオブジェクトがあっても文字列に変換することができます。
Upper(text) 文字列をすべて大文字に変換します。
例: "hello" → "HELLO"
Lower(text) 文字列をすべて小文字に変換します。
例: "HELLO" → "hello"
AddMark(text, mark, position) 文字列の指定した位置にマーク(mark)を追加します。
positionには "start"か"st", "end"か"ed", または整数を指定できます。
例: "hello" → "★hello", "hello" → "hello★"
Short(text, length) 文字列の先頭から指定した長さだけ切り出します。
例: `"JavaScript" → "Java"(長さ4)
Cut(text, start, end) 指定された開始位置から終了位置まで文字列を切り出します。
**例: "Hello World""Hello"(0-5文字目)
Reverse(text) 文字列を逆順にします。
例: "abc""cba"
Replace(text, from, to) 文字列内の fromto に置換します。
例: "JavaScript""JS"("Java" を "JS" に置換)
PE(text, length, mark) 文字列を length まで mark で埋めます。
**padEnd に相当します。
**例: "abc""abc*****"(長さ8)
Repeat(text, times) 文字列を指定回数繰り返します。
例: "Hi""HiHiHi"(3回繰り返し)
Length(text) 文字列の長さ(文字数)を取得します。
例: "JavaScript"10

english Version

str.js is a lightweight and flexible JavaScript library that makes string manipulation easy. This tool makes string formatting easy.


Main Features

  • 🛠️ Simple and intuitive API
  • 🤝 High compatibility with other JavaScript libraries
  • Lightweight and fast

Installation

Download from the link below:

Download v1.0.6 str.js

You can also clone it with Git:

git clone https://github.com/imorun/str.js.git

Function List

Function Name Description
str(text) Converts any value to a string.
Can convert numbers, objects, etc., into a string.
Upper(text) Converts the string to uppercase.
Example: "hello" → "HELLO"
Lower(text) Converts the string to lowercase.
Example: "HELLO" → "hello"
AddMark(text, mark, position) Adds a mark (mark) at a specified position.
You can specify "start"or"st", "end"or"ed", or a number for position.
Example: "hello" → "★hello", "hello" → "hello★"
Short(text, length) Extracts the first length characters from the string.
Example: "JavaScript" → "Java" (length 4)
Cut(text, start, end) Extracts the string from position start to position end.
Example: "Hello World""Hello" (0-5 characters)
Reverse(text) Reverses the string.
Example: "abc""cba"
Replace(text, from, to) Replaces from with to in the string.
Example: "JavaScript""JS" (replaces "Java" with "JS")
PE(text, length, mark) Pads the string to length with the mark character.
Equivalent to padEnd.
Example: "abc""abc*****" (length 8)
Repeat(text, times) Repeats the string times number of times.
Example: "Hi""HiHiHi" (repeated 3 times)
Length(text) Returns the length (number of characters) of the string.
Example: "JavaScript"10

About

String to str

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors