Category "replace"

Search and replace in 1 step instead of 3 with Vim regex

I have this code that I'd like to transform: const createFacebookAdVideoPayload = { const accountId = faker.datatype.uuid(); const pu

Javascript method to capitalize the first letter of every word and also every word after hyphen or dash

I need a JavaScript method to allows me to convert the first letter of every word in a string to a capital letter like this: mike tyson wayne to Mike Tyson Wayn

Is there a simpler way to hide a message in text?

I'm a newbie in Python. I have a sample.txt with random generated numbers, like: 190372210335873910924370795570288776927025955114012905862203094277820432758989

Can't remove backslash from string in Python

I want to remove backslash from a string, I tried result.replace('\\','') but nothing changed. Anyone has an idea how I can remove it? result = '[(\'company_ids

Speed up millions of regex replacements in Python 3

I have two lists: a list of about 750K "sentences" (long strings) a list of about 20K "words" that I would like to delete from my 750K sentences So, I have to l

how to replace a single key value pair from an object in react.js

I have a single object of with key value pair, and i need to replace the first key value pair with a new key value in react.js. I have tried to make immutable p

Regex for double quotes inside string

A follow up to my previous question here. I realize I need to be more specific regarding my regex case to get an answer that works for my case. I am fighting w

replace text between two strings in a file - python

i have a sh file, i need my python script to find specific strings and replace all the text between them in it: hello_example=( # <- this specific line "bla"

Powershell - add string after 14th 24th 36th 46th and 55th character following a word

We have many files which contain header lines beginning with HDR that need to be updated for clarity. I am new to coding in powershell and would like to know h

Use Wildcards in Replace Function in combination with 2D Array Values

I'm trying to go through a list with two columns and replace some of the text in the second column. I want to search for values using wildcards in combination w

How to replace values in column when other column is not nan or replace with other?

I am new to Pandas, I am looking for solution where I can replace one column values with other columns. For eg: Replace value of col A with the values in Col E

Replacing characters from string in python list

I have a list of names of apple products in random format. like take a single product name iphone 11 pro which can be found Iphone 11 Pro or iphone 11 Pro, or a

How do I force a blank for rows in a dataframe that have any str or character apart from numerics?

I have a datframe >temp Age Rank PhoneNumber State City 10 1 99-22344-1 Ga abc 15 12 No Ma xyz For the column(Phone Numbe

about replace methods in string in js

let code = document.querySelector('.Nform').innerHTML; localStorage.setItem('code',JSON.stringify(code)); let finalCode = code.replace(/ <p class="removeElem

How can I avoid warnings when importing numbers by replacing comma's with a dot in a MySQL table?

I have a table in Mysql that looks like: CREATE TABLE `overig`.`test`( `ID` INT(10) AUTO_INCREMENT, `Order_ID` DECIMAL(10) NOT NULL, `Price_total` DECIMAL(12,2)

How to print html code tags in a specific element?

<div class="container"> <pre> <code class="language-html"> <h1>I want to display html tag</h1> <

remove consecutive substrings from a string without importing any packages

I want to remove consecutive "a" substrings and replace them with one "a" from a string without importing any packages. For example, I want to get abbccca from

Need replace text with single quotes in SQL

I need to make a script that make a replacement of all the registers of a column that contains: '@xxxx', removing the single quotes. (xxxx could be empty or any

Use of Replace() in Python Dataframe for Multiple Columns but same value

Query: I need to replace the 1 old value with the 1 new value for a bunch of columns (not all columns) in a dataframe. The question is about the syntax to be us

js/ts translate internal commands

I am currently trying to translate some text-based console-log processing into JSON format. Console.log commands: give ENTITY.name = "entitytest"; give entity.u