#Download v1.0.6 str.js
English explanation
str.jsは、文字列操作を簡単に行える軽量で柔軟なJavaScriptライブラリです。このツールは、文字列のフォーマットを簡単に行うことができるツールです。
- 🛠️ シンプルで直感的なAPI
- 🤝 他のJavaScriptライブラリとの互換性が高い
- ⚡ 軽量で高速
以下のリンクからダウンロードしてください:
また、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) |
文字列内の from を to に置換します。例: "JavaScript" → "JS"("Java" を "JS" に置換) |
PE(text, length, mark) |
文字列を length まで mark で埋めます。** padEnd に相当します。**例: "abc" → "abc*****"(長さ8) |
Repeat(text, times) |
文字列を指定回数繰り返します。 例: "Hi" → "HiHiHi"(3回繰り返し) |
Length(text) |
文字列の長さ(文字数)を取得します。 例: "JavaScript" → 10 |
str.js is a lightweight and flexible JavaScript library that makes string manipulation easy. This tool makes string formatting easy.
- 🛠️ Simple and intuitive API
- 🤝 High compatibility with other JavaScript libraries
- ⚡ Lightweight and fast
Download from the link below:
You can also clone it with Git:
git clone https://github.com/imorun/str.js.git| 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 |