このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
js:build-in:string [2021/09/07 12:02] tanaka [正規表現] |
js:build-in:string [2021/09/13 11:02] (現在) y2sunlight |
||
---|---|---|---|
行 16: | 行 16: | ||
* [[# | * [[# | ||
* [[# | * [[# | ||
+ | * [[# | ||
* [[# | * [[# | ||
* [[# | * [[# | ||
行 34: | 行 35: | ||
* [[# | * [[# | ||
* [[# | * [[# | ||
- | * [[#matchAll()|matchAll()]] | + | * [[#search()|search()]] |
* [[# | * [[# | ||
+ | * [[# | ||
* [[# | * [[# | ||
- | * [[# | ||
* [[# | * [[# | ||
- | * [[# | ||
* [[# | * [[# | ||
* [[# | * [[# | ||
行 263: | 行 263: | ||
let str = " こんにちは "; | let str = " こんにちは "; | ||
console.log(str.trimEnd()); | console.log(str.trimEnd()); | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | === charAt() === | ||
+ | |||
+ | <code javascript> | ||
+ | let character = str.charAt(index) | ||
+ | </ | ||
+ | |||
+ | 指定された位置の文字 (UTF-16 コード 1 つから成ります) を返します。詳しくは[[https:// | ||
+ | |||
+ | <sxh javascript; | ||
+ | let str = " | ||
+ | console.log(str.charAt(6)); | ||
</ | </ | ||
行 587: | 行 601: | ||
<code javascript> | <code javascript> | ||
- | const newStr = str.replaceAll(regexp|substr, newSubstr|function) | + | const newStr = str.replaceAll(searchFor, replaceWith) |
</ | </ | ||
行 594: | 行 608: | ||
<sxh javascript; | <sxh javascript; | ||
let str = " | let str = " | ||
- | console.log(str.replaceAll(/ | + | console.log(str.replaceAll(/ |
</ | </ | ||
行 600: | 行 614: | ||
==== コード変換 ==== | ==== コード変換 ==== | ||
- | |||
- | === charAt() === | ||
- | |||
- | <code javascript> | ||
- | let character = str.charAt(index) | ||
- | </ | ||
- | |||
- | 指定された位置の文字 (UTF-16 コード 1 つから成ります) を返します。詳しくは[[https:// | ||
- | |||
- | <sxh javascript; | ||
- | let str = " | ||
- | console.log(str.charAt(6)); | ||
- | </ | ||
- | |||
- | \\ | ||
=== charCodeAt() === | === charCodeAt() === |