gsub(pattern, replace) -> String[permalink][rdoc][edit] æååä¸ã§ pattern ã«ãããããé¨åå ¨ã¦ãæåå replace ã§ç½®ãæããæååãçæãã¦è¿ãã¾ãã ç½®ææåå replace ä¸ã® \& 㨠\0 ã¯ãããããé¨åæååã«ã \1 ... \9 㯠n çªç®ã®æ¬å¼§ã®å 容ã«ç½®ãæãããã¾ããç½®ææååå ã§ã¯ \`ã\'ã\+ ã使ãã¾ããããã㯠$`ã$'ã$+ ã«å¯¾å¿ãã¾ãã [PARAM] pattern: ç½®ãæããæååã®ãã¿ã¼ã³ã表ãæååãæ£è¦è¡¨ç¾ãæååãæå®ããå ´åã¯å ¨ãåãæååã«ã ãããããã [PARAM] replace: pattern ã§æå®ããæååã¨ç½®ãæããæåå ä¾ p 'abcdefg'.gsub(/def/, '!!') # => "abc!!g" p 'abcabc'.g
{{#tags}}- {{label}}
{{/tags}}