Category "string"

How to check if a string is alphanumeric?

I can use occursin function, but its haystack argument cannot be a regular expression, which means I have to pass the entire alphanumeric string to it. Is there

Copying a certain number of characters from one pointer to another

I have a source pointer (pSource) and a goal pointer (pGoal). I also have a number of characters (n) that need to be copied to the pGoal from pSource. I thought

How can I change the order of some string in a filename

I have lots of files like these: tf_CVBV6Z_CVSA1Z_pws2_pcc1.sac tf_CVBV5Z_CVSA2Z_pws2_pcc1.sac tf_CVBV4Z_CVSA3Z_pws2_pcc1.sac tf_CVBV3Z_CVSA4Z_pws2_pcc1.sac tf

How to count groups string input with same character

this code is about Too Many Tabs code. URLs are considered equal if the domains are exactly the same, e.g. google.com and google.co.id are different Example inp

Finding how many times a given string is a substring of another string using scala

what is the elegant way for finding how many times a given string is a substring of another string using scala? The below test cases that should make clear wh

Removing all instances of the second string from the first

The question states: Write code that takes two strings from the user, and returns what is left over if all instances of the second string is removed from the fi

Extract the century of a date from a string

My task is to output the current century of a given date. The date can be represented as a string; for example, 19.03.2022. How can I retrieve the year and cent

Search and replace specific strings with floating point representations in python

Problem: I'm trying to replace mutiple specific sequences in a string with another mutiple specific sequences of floating point representations in Python. I hav

Write a macro function to change the case of a string?

// I tried this code #include<iostream> using namespace std; // Function to convert characters // of a string to opposite case #define case_change(s

Memory usage of concatenating strings using interpolated vs "+" operator

I see the benefit of using interpolated strings, in terms of readability: string myString = $"Hello { person.FirstName } { person.LastName }!" over a concate

Js How to got the sum of numbers from a string?

I'm new to coding and have been given this question; Create a function that takes a string with a jumble of letters and numbers. It should add together all the

Changing the int and string from a string

The format_address function separates out parts of the address string into new strings: house_number and street_name, and returns: "house number X on street nam

How to Paste string of values in single cell of Excel using VBA

I have 2 sheets named "Target Data" and "Pivot". I have filtered data in "Target Data" and now want to copy only visible cells in single cell of "Pivot" sheet.

What is the Big O notation for string.Contains() in GoLang?

strings.Contains(str, substr) N = len(str) M = len(substr) Is Average case = O(N/2 + M) Worst case = O(N - M)?

Perl: Multidimentional arrays and "experimental push" error

I'm a junior perl programmer and have very little experience with multidimentional arrays. I'm not even sure it is the proper data structure for this project. I

Python: remove single quotation in a string in a list

I have a list of items, list1, shown below: ["None", "A ','B", "A"] The second element of list1 is "A ','B". How can I remove the single quotation mark and

Python : Extract mails from the string of filenames

I want to get the mail from the filenames. Here is a set of examples of filenames : string1 = "[email protected]_2022-05-11T11_59_58+00_00.pdf" strin

How to Trim "[" char from a string in Golang

Probably a silly thing but got stuck on it for a bit... Can't trim a "[" char from a string, things I tried with outputs: package main import ( "fmt"

Copy data to another spreadsheet based off value stored in string

I have the below code for one of my financial reports and I'm struggling with updating the code to make it more automated. The code creates a string of the colu

How to extract values from a String that cannot be converted to Json

While processing the DialogFlow Response object, I get the below given string as textPayload. If this is a Json string, I can easily convert it to a JSONObject