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.
私は以下を削除しようとしています:" (23wr)"
" (23wr)"
使用した空白を削除するには、を削除するに.gsub(/\s+/, "")はどうすればよいですか?'('')'"23wr"
.gsub(/\s+/, "")
'('
')'
"23wr"
このコードを試してください:
gsub(/[\s+)(]/,"")
正規表現なし:
p " (23wr)".delete("( )\t") #=> "23wr"