I need to replace a string like " 123456 " with " ,123456 ".
123456
,123456
I have tried this.
address = address.gsub(/\d{6}/, "")
But I do not know how to tell gsub use the value associated with " , ".
gsub
,
I found the answer here :
address.gsub /(\d{6})/, ',\1'
address.gsub! /^/, ','
Either you only need this, or you do not have enough context.
Source: https://habr.com/ru/post/1388622/More articles:Android: multiline text view in Tablerow vertically - androidWould you like to use your current location! Using ALAssetsLibrary - iosAfter that, Javascript will confirm the PHP function - javascriptBackbone.js - why is my delegateEvents switch not working? - backbone.jsHow to remove an event of an element declared by an anonymous function? - javascriptChange dependencies depending on the type of target project - nugetDifficulties with launching iOS 5 application on iOS 4 - iosFormat resource string to another? - c #Why does Wicket change the action attribute of a form tag without a gate? - javahttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1388627/cleaning-up-repositories-in-gitextensions&usg=ALkJrhgDrkZdln0B83zRNSThqVRcchviPgAll Articles