Questions tagged [character-replacement]

72 questions
2
votes
1 answer

R - check for substring within string, if true then add value to a different variable

I want to do something that I am sure is very simple, but I have little R experience. I have a variable with value that are different strings. I want to check if each value contains a substring, and, if so, to add another value to a DIFFERENT…
Socratease
  • 47
  • 1
  • 9
1
vote
0 answers

Microsoft Editor's  object replacement character

I am using Microsoft Editor feature (Windows 11) a lot - I really depend on it, and I find all its features equally useful (Spelling Suggestions, Grammar Suggestions), but I find especially useful to me suggestions regarding spacing (this falls…
1
vote
2 answers

Given an offset dictionary and a string, create the BIO tags

Given (i) a string text and (ii) a dictionary made of offset and the substring y: text =…
alvas
  • 115,346
  • 109
  • 446
  • 738
1
vote
1 answer

Replace tablespoon/s and teaspoon/s

I'm using BBEdit or Visual Code and I'm not too experienced with regex but would like to do a simple find and replace to all instances of "teaspoon(s)" (as in teaspoon or teaspoons) and "tablespoon(s)" with "tsp" and "tbsp". replace: 1 tablespoon…
Myslnik
  • 37
  • 1
  • 7
1
vote
1 answer

Google Sheets Problem w/ Substring Replacement Text Using =Left

Trying to fix some malformed data. Here is the formula I'm using: ={"Final Name";ARRAYFORMULA(IFERROR(IF(ISBLANK(E3:E),,LEFT(E3:E,find(".",E3:E)-2))))} Here is a sample of the data in colE. The list indent is not part of the data, it's just…
1
vote
3 answers

Is there a Python function to make all possible substititutions between two equal length strings?

I am trying to make all possible substitutions between a reference and a test sequence. The sequences will always be the same length and the goal is to substitute Test characters with those of Ref. Ref= "AAAAAAAAA" Test="AAATAATTA" Desired…
Patrickc01
  • 145
  • 1
  • 1
  • 6
1
vote
1 answer

AWS Lambda replacing certain characters from attachments of multipart-form data with replacement character(U+FFFD)

I am using AWS lambda function to receive a multipart request with attachments and upload them to S3. But Lambda function replaces few characters with the replacement character and so the attachment getting corrupt. I checked on a PNG file. sample…
1
vote
2 answers

Javascript: How to replace all "\" character to ""

I try to replace "\" character to empty "" but I can't do it. How to solve it? Here is my code abc = abc.replace('\','');
Chan Yoong Hon
  • 1,592
  • 7
  • 30
  • 71
1
vote
1 answer

Remove all occurence of ';' in C++ comments with SED

I'm new to sed and I can't manage to use it to remove all ';' characters in comments of C++ files, ie lines starting or containing the string "//" (I already convert "/* ... */" comments to "// ..." comments). For example : // lorem; ipsum ;…
Iwaa
  • 13
  • 3
1
vote
2 answers

Replace special characters in multiple strings between two strings in PowerShell

Background: I changed filenames of .mp4 videos to lowercase and replaced the special characters as well as spaces. Now I have to change the associated URLs inside of .txt files in a similar manner. There are many text files which contains plenty of…
fuchur2502
  • 25
  • 5
1
vote
1 answer
1
vote
1 answer

Replacing Characters in C

This is part of a lab assignment I have to implement the following function... void replaceChar(char s[], char c,int len) Description: Replace every character of s with c. len indicates the length of s. I submit this to the autograder that my…
Matt Altepeter
  • 317
  • 2
  • 5
  • 17
0
votes
1 answer

Javascript character restriction - invalid characters show up temporarily

I am using Javascript to restrict the characters of various text entry fields as a form of client-side validation as well as improved usability. I am using the following code to do this: function validNumbers(caller) { var exp = /^[\d.]+/g; …
Adam
  • 3,668
  • 6
  • 30
  • 55
0
votes
1 answer

How to reduce code's margin (=number of spaces) using Regex?

Recently, on Notepad++, I want to reduce number of spaces at begin of lines. I searched a Regular Expression, but I don't find any. On a array(=tab) of Notepad++, I have following lines

ligne normale

ligne…

schlebe
  • 3,387
  • 5
  • 37
  • 50
0
votes
0 answers

using powershell to get a string out of one file and replace this value in another file

i'm trying to get a string out of a file and want this string to be inserted/replaced in another file with Powershell commands file1: "buildnumber": "[it's a value that contains the last commit id]" file2: "buildnumber": "xxxxxxxx" File 1…