Category "replace"

finding and replacing elements in a multidimensional list (python)

Similar to this question: finding and replacing elements in a list (python) but with a multi-dimensional array. For example, I want to replace all the N's with

Efficient way to edit the last line of a text file in Python

I have a Python script which creates a large SQL insert file of about 300,000 lines. The problem with this is that the last line of the file ends up looking lik

Replace a name in a string in Python

I'm working on a assignment and I need to replace Alice with my name. Here is the program, for i in range(10): print(i) print(split_alice[i]).replace_a

VS Code Extension API - Replace a String in the document?

const textEditor = vscode.window.activeTextEditor; if (!textEditor) { return; // No open text editor } for(var i=

How do i replace [] brackets using SED

I have a string that i am want to remove punctuation from. I started with sed 's/[[:punct:]]/ /g' But i had problems on HP-UX not liking that all the time

IntelliJ replace variable names in multiple lines

I am wondering is there a shortcut that can replace a variable name with a new name on multiple lines in the current Java file for IntelliJ. Is it just simply d

How to replace first occurrence of string in Java

I want to replace first occurrence of String in the following. String test = "see Comments, this is for some test, help us" **If test contains the input as

Regex to replace all password with ***

I have the following json: Data: {"Account":"d\\adm","Password":"cWExZjEiMTM="},"SqlServer":{"InstanceName":"","MachineName":"MyMachine","Port":null} I would

regular expression to copy line with some changes, mirror

I have a code in each html page that I want to duplicate, while add some changes: Example: <title>Any text (even if includes :.,</title> Output: