Category "string"

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 remove substring starting with RT and ends with ":"

I have a dataset with a column consisting of tweets. Some tweets are retweets, which start with RT @username: ..... I would like to remove this part of the stri

Check if string exists in list made with data from a csv file

I import data from a csv file and then store it in a list (List<Customer> customers). The data is added to the list by creating and adding objects. The ob

How to write millions of double values into a txt file

I've made a neural network and now I need to save the results of the training process into a local file. In total, there are 7,155,264 values. I've tried with a

Keyword repeated multiple times in context from string in R

I have a dataset (z) with strings which are very long in z$txt. I also have a dictionary (incd) of keywords that need to be identified. In the column z$inc.term

How to insert text after a certain string in a file with variables

I have these variables: file_path="/home/dir/file.xml" string="<host mac='0A:00:DD:D2:00:02' name='vfp-20vr' ip='10.10.1.122'/>" This is the content of f

I need a function to delete certain characters from a char array in c++ without using any index

for example: if the user enters : ( 23+22+43) I want the function to do exactly the following : for(int i =0; i <strlen(x);i ++) { if (x[i]=='+') {

How do I change the only the first word of every line in a text file?

So I have actually worked out how to change the first word but the problem is its not just changing the first word only. So i have a file such as : 2 0.268278 0

How can I sort a list of strings in ascending order of numeric part

I have a list of paths which have multiple numerical parts within them, here is part of it: 'C:\\Python\\Python310\\Scripts\\mockup_test\\17mm.JPG', 'C:\\Python

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

Split numbers and dates into separate columns

My data contains text strings with three important features, an id number separated by":" and a starting date and an end date. I need to get these tree numbers

c# StringExtension with Method Space

I try to create a string extension with the method Space(int) in it. If I have an instance of a string, then its no problem. But without I have no Idea. The cal

Splitting a Rust string into a Vec of its substrings with contiguous identical characters

I have a string or a &str of ASCII characters and I want to separate it into a Vec of all substrings with contiguous identical characters (for example, "aab

ValueError: could not convert string to float: '<kivy.uix.textinput.TextInput object at 0x0000011D49678430>'

I'm new at python and right now i try to make similar calculator with user input. I rewrote my code but its still dont work fine. Cant convert string property t

WAP to accept a string and print only the words having consecutive letters as same and number of occurrences [duplicate]

I was solving this question(the title) and I cant find the mistakes present so please help Input : The buffalo is stuck in a soggy field and

i want to echo this string but its not working [closed]

I intend to echo the string if the string isn't longer than 20 characters. But it's not working even though the string isn't longer than 20 c

Javascript - Giving alert for string input but number

Hi recently I was writing a code which basically askes users to input a cost for any item. The item name or price are not important so far. How the system works

Using qsort to sort a multidimensional array of variable-length strings in C

I have a piece of software that generates a rather large text file full of information about files in a directory. There are often several thousand files. Each

Pandas series str.contain check

I am looking to search each value in a pandas series to see if it contains one of many possible sub strings. What is the best way to check multiple str values a

R replace string in df with partial match in a list

I have a dataframe (df) in R and I want to create a new column (city1_n) that contains a line stored in the list key whenever there is a partial match between c