string Questions

9

Solved

Is it possible in PowerShell, to truncate a string, (using SubString()?), to a given maximum number of characters, even if the original string is already shorter? For example: foreach ($str in "h...
Balsam asked 14/1, 2015 at 13:38

10

Solved

It's a capital A with a ^ on top: Â It is showing up in strings pulled from webpages. It shows up where there was previously an empty space in the original string on the original site. This is the...
Steppe asked 25/8, 2011 at 7:27

8

I want to check whether the given string is single- or double-quoted. If it is single quote I want to convert it to be double quote, else it has to be same double quote.
Thyrse asked 15/12, 2009 at 12:6

8

Solved

I am trying to split (or explode) a string in Swift (1.2) using multiple delimiters, or seperators as Apple calls them. My string looks like this: KEY1=subKey1=value&subkey2=valueKEY2=subkey1...
Breadnut asked 8/9, 2015 at 18:49

2

Solved

There are a few ways to get the list of all Unicode characters' names: for example using Python module unicodedata, as explained in List of unicode character names, or using the website: https://un...
Enate asked 5/12, 2020 at 15:31

7

After TONS of research, I have found how to parse emoji in realtime using the Twemoji library. Now, I need to figure out how to identify if there's emoji within some text, grab the position of tha...
Jolynnjon asked 7/5, 2016 at 13:53

14

Solved

I'd like to break apart a String by a certain length variable. It needs to bounds check so as not explode when the last section of string is not as long as or longer than the length. Looking for th...
Heymann asked 9/6, 2010 at 18:29

6

I have two strings: short_string = "hello world" long_string = "this is a very long long long .... string" # suppose more than 10000 chars I want to change the default behavior of print to: put...
Doane asked 27/9, 2013 at 9:11

3

Solved

I have a little problem with a column on a table. The column is a Varchar named "prize". The datas are something like: 00008599 00004565 00001600 etc... They have to become: 85.99 45.65 16.00 e...
Gratt asked 25/10, 2012 at 9:29

3

Solved

Running $ docker-compose up when I have my docker-compose.yml as the following, everything works as expected: app: build: . However when I have docker-compose.yml as (which appears to valid wi...
Fool asked 1/12, 2016 at 18:18

7

Solved

In R, suppose I have a vector like: vector<-c("Red", " ", "", "5", "") I want to count how many elements of this vector are just empty strings ...
Phocomelia asked 30/6 at 19:21

13

Solved

I am using Ubuntu and I am tired of this long prompts in bash when I am working with some deep directory hierarchy. So, I would like to tweak my PS1 to shorten the working directory part the follow...
Voltz asked 16/4, 2011 at 15:17

40

Solved

Given a string S of length N find longest substring without repeating characters. Example: Input: "stackoverflow" Output: "stackoverfl" If there are two such candidates, return first from left...
Ensphere asked 16/3, 2012 at 9:11

2

Solved

I try to encode a string in Windows-1252 with a StreamWriter. The input string (dataString) is encode in UTF8. StreamWriter sw = new StreamWriter(@"C:\Temp\data.txt", true, Encoding.GetEncoding(12...
Pileup asked 6/11, 2012 at 16:55

9

Solved

For doing string concatenation, I've been doing basic strcpy, strncpy of char* buffers. Then I learned about the snprintf and friends. Should I stick with my strcpy, strcpy + \0 termination? Or sh...
Exerciser asked 9/4, 2010 at 10:12

4

Solved

Does Lua provide a function to make the first character in a word uppercase (like ucfirst in php) and if so, how to use it? I want keywords[1] to be first letter uppercase. I've read that string.u...
Churr asked 11/3, 2010 at 0:18

5

Solved

I am unsure why I am getting this error count=int(input ("How many donuts do you have?")) if count <= 10: print ("number of donuts: " ) +str(count) else: print ("Numbe...
Greatest asked 23/2, 2013 at 3:10

1

Solved

I have a Prometheus metric as shown below query_duration{query = "SELECT * FROM TABLE_NAME"} I'm trying to extract only TABLE_NAME from the label query. I'm trying to use regex to extrac...
Hembree asked 19/6 at 9:53

4

As per my research, Kotlin has two types of string literals:- Escaped strings that may have escaped characters in them . val s = "Hello ,World\n" + "from escaped string\n"+ "kotlin" Raw str...
Ric asked 20/9, 2018 at 6:22

7

Solved

I'm looking for a quick way (in C#) to determine if a string is a valid variable name. My first intuition is to whip up some regex to do it, but I'm wondering if there's a better way to do it. Like...
Pulcheria asked 1/12, 2009 at 23:28

9

Solved

I know that the following: String s = null; System.out.println("s: " + s); will output: s: null. How do I make it output just s: ​? In my case this is important as I have to concatenate Strin...
Schaumberger asked 5/7, 2014 at 5:58

26

I'm using basic JavaScript to count the number of vowels in a string. The below code works but I would like to have it cleaned up a bit. Would using .includes() help at all considering it is a stri...
Nummulite asked 4/4, 2015 at 19:12

6

Solved

I have this string: hello world hello world hello world hello and I need to get the following: hello world hello hello hello If I use: str = str.replace('world', ''); it only removes the f...
Landowner asked 24/4, 2018 at 23:31

5

Solved

Problem Is there a way in Typescript to define a type that is only a string literal, excluding string itself? Note that I am not talking about a certain list of string literal; for which, a simpl...
Glaswegian asked 12/2, 2020 at 9:30

5

Solved

I am having trouble with the following code, I am trying to build a lexer. Again I am using the examples from F# for Scientists. let lines_of_file filename = seq { use stream = File.OpenRead fi...
Pliable asked 26/9, 2011 at 15:26

© 2022 - 2024 — McMap. All rights reserved.