Category "string"

First Not Repeating Character Code

Here is the question: Write a solution that only iterates over the string once and uses O(1) additional memory, since this is what you would be asked to do duri

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

How to convert binary string to normal string in php

Description of the problem I am trying to import email content into a database table. Sometimes, I get an SQL error while inserting a message. I found that it f

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 escape a series of backslashes in a bash printf?

The following script yielded an unexpected output: printf "escaped slash: \\ \n" printf "2 escaped slashes: \\\\ \n" printf "3 escaped slashes: \\\\\\ \n" prin

Why all the test cases are not getting passed for the below question?

The Coding Question which I am trying to solve is this. I tried to solve but not all the test cases passed I am not able to find what could be the reason? Iden

How to split a Thai sentence, which does not use spaces, into words?

How to split word from Thai sentence? English we can split word by space. Example: I go to school, split = ['I', 'go', 'to' ,'school'] Split by looking only s

How to split a Thai sentence, which does not use spaces, into words?

How to split word from Thai sentence? English we can split word by space. Example: I go to school, split = ['I', 'go', 'to' ,'school'] Split by looking only s

Windows PATH to posix path conversion in bash

How can I convert a Windows dir path (say c:/libs/Qt-static) to the correct POSIX dir path (/c/libs/Qt-static) by means of standard msys features? And vice vers

List<String> as input of GET method

I have a REST service. The input type of the GET method is List<String>: @GET @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public L

How to use sed/grep to extract text between two words?

I am trying to output a string that contains everything between two words of a string: input: "Here is a String" output: "is a" Using: sed -n '/Here/,/

Trim string's suffix or extension?

For example, I have a string, consists of "sample.zip". How do I remove the ".zip" extension using strings package or other else?

Go StartsWith(str string)

Is there a StartsWith(str1, str2 string) function that can check if str1 is a prefix of str2 in Go language? I want a function similar to the Java's startsWith

How to extract last part of string in bash?

I have this variable: A="Some variable has value abc.123" I need to extract this value i.e abc.123. Is this possible in bash?

Fix string encoding issues

Does anyone know of a .Net library (NuGet package preferrably) that I can use to fix strings that are 'messed up' because of encoding issues? I have Excel* fil

Removing leading zeros from a string in SQL Server 2008 R2

I have a string representing a batch number of goods, for example "0000AZA001B". I only need the "AZA001B" part. How can I achieve that in SQL Compact?

How to replace " into space or delete first and last symbol?

I get xml data and I get value from it. I need to delete symbols [ and ] Here is my code, that gives me error about undegined variable: @xml = XmlSim

Printing hex from dx with nasm

I actually want to print the content of the dx register with nasm. Thereby the content is a 16 bit hex digit such as 0x12AB. Therefore I've first implemented a

Printing hex from dx with nasm

I actually want to print the content of the dx register with nasm. Thereby the content is a 16 bit hex digit such as 0x12AB. Therefore I've first implemented a

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