What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-12 11:43:02
js method string remove extra spaces
str.replace(/\s+/g, '') Add solution -
Python 2021-09-11 23:34:03
pandas string manipulation on column
In [21]: def func(string): a_new_string =string.replace('- ','_') a_new_string1 =a_new_string.replace('-','_') a_new_string2= a_new_string1.rstrip(' months') return a_new_string2 df['Time'] = df['Time'].apply(func) df Out[21]: Time 0... Add solution -
Go 2021-09-10 20:50:02
Go replace all occurrences of a substring with another one
import ( "fmt" "strings" ) func main() { value := "The quick brown fox jumps over the lazy dog" // Replace the "fox" with a "horse." result := strings.Replace(value, "fox", &... Add solution -
Javascript 2021-09-10 20:43:02
javascript add update query parameter to url
function update_query_parameters(key, val) { uri = window.location.href .replace(RegExp("([?&]"+key+"(?=[=&#]|$)[^#&]*|(?=#|$))"), "&"+key+"="+encodeURIComponent(val)) .replace(/^([^?&... Add solution -
Javascript 2021-09-10 12:50:02
javascript replace newline with br
function nl2br(str){ return str.replace(/(?:\r\n|\r|\n)/g, '<br>'); } var stringWithNewLines= `Well this is a a very broken sentance`; var stringWithBrs=nl2br(stringWithNewLines); // stringWithBrs= "Well this is a<br>a very <br... Add solution -
Html 2021-09-10 08:26:01
jquery replace all spaces in string
<body> Title : <input type="text" id="title"><br/> Keyword : <input type="text" id="keyword"> </body> <script> $('#title').keyup(function() { var replaceSpace = $(this).... Add solution
Best helpers
Ranking is empty