Category "string"

Pandas - Duplicate Rows and Slice String

I'm trying to create duplicate rows during a dataframe on conditions. For example, I have this Dataframe. students = [ ("a", "Ursula"), ("b", "Hayfa, Ma

How to compress a C++ string using Zstd?

I'm very new to C++ and I wanted to compress a std:string object via Zstd compression library, but so far I couldn't find a C++ sample code for this purpose by

How can I reverse a single String in Java 8 using Lambda and Streams?

I have one string say "Aniruddh" and I want to reverse it using lambdas and streams in Java 8. How can I do it?

Reverse String characters in java

Am trying to reverse a string using a method in java, I can fetch all the elements of the string and print them out in order via a loop, my problem is reversing

Format currency in JavaScript removing .00

I am currently formatting numbers to display as currency values using the following code: return symbol + value.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,"

How to reverse a string that contains complicated emojis?

Input: Hello world👩‍🦰👩‍👩‍👦‍👦 Desired Output: 👩‍👩‍👦‍👦

Input: a2b3c4 and Output: aabbbcccc

The code I've written is not producing any output. It just takes the string as an input: #include<stdio.h> #include<conio.h> #include<string.h&g

How to check if a string is a substring of another even if not in order?

Is there a way to check if a string contains another string but not necessairely in the correct order : "hel my frend" in "hello my friend" = true "hel my fren

MATLAB: Subindexing in cell array based on results of strfind

I have a cell array, like so: ID = {'g283', 'sah378', '2938349dgdgf', 'g283'}; I also have some data that corresponds to these IDs. Data = {'data1', 'data2'

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