Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
var alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
Hとの間のすべてを削除Sして、結果が になるようにするにはどうすればよいABCDEFGHSTUVWXYZですか?
H
S
ABCDEFGHSTUVWXYZ
var alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; console.log( alphabet.replace(/H.*S/, 'HS') )
あるいは単に:
var alphabet = "ABCDEFGHSTUVWXYZ";
var strippedAlphabet = alphabet.replace(/H.*S/, 'HS');