string Questions
5
Solved
i need to get the string value of a color. in other words i want to pull the #ffffffff from a color resource like <color name="color">#ffffffff</color> in string format. is there any wa...
6
Solved
I am trying to write a regex to get the numbers from strings like these ones:
javascript:ShowPage('6009',null,null,null,null,null,null,null)
javascript:BlockLink('2146',null,null,null)
I am having...
18
I am trying to find a similar function to strstr that searches a substring starting from the end towards the beginning of the string.
3
Are line breaks in raw strings platform-dependent?
val a = "one\ntwo";
val b = """one
two"""
println(a == b)
In other words, is the println statement above guaranteed to print true or not?
Wilhelminawilhelmine asked 21/10, 2017 at 9:4
3
Solved
Motivation
Suppose you have a string that is used twice in one string. However, in one case it is upper, and the other it is lower. If a dictionary is used, it would seem the solution would be to ...
Florescence asked 6/3, 2019 at 12:33
14
Solved
I would like to copy the contents of a vector to one long string with a custom delimiter. So far, I've tried:
// .h
string getLabeledPointsString(const string delimiter=",");
// .cpp
string Gestur...
9
Solved
I am trying to create a program that detects if multiple words are in a string as fast as possible, and if so, executes a behavior. Preferably, I would like it to detect the order of these words to...
7
I have a python script that, for various reasons, has a variable that is a fairly large string, say 10mb long. This string contains multiple lines.
What is the fastest way to remove the first and l...
Barquentine asked 25/1, 2015 at 7:45
7
I am stripping off double quotes from a string, but I keep getting this error from the following function. What is the problem here?
void readCSVCell(stringstream& lineStream, string& s) {...
Aboulia asked 15/4, 2011 at 8:49
6
Solved
Since str_replace() matches :Name two times in :Name :Name_en, I want to match the results for the whole word only. I wanted to switch to preg_replace() because of this answer.
$str = ":Name :...
Nutt asked 13/3, 2012 at 10:53
7
Solved
If I have a UTF-8 std::string how do I convert it to a UTF-16 std::wstring? Actually, I want to compare two Persian words.
5
Solved
Given a string s in Lua:
s = "abc123"
If the string is non-empty, I want to store the first character of this string in a variable s1, else store nothing.
I've tried the following, but b...
14
Solved
How many String objects are created by the following code?
String x = new String("xyz");
String y = "abc";
x = x + y;
I have visited many websites where some say that this line of code cre...
8
I've been using C# String.Format for formatting numbers before like this (in this example I simply want to insert a space):
String.Format("{0:### ###}", 123456);
output:
"123 456"
In this par...
Caracalla asked 7/10, 2014 at 10:11
8
Solved
I know how to encode / decode a simple string to / from base64.
But how would I do that if the data is already been written to a FileStream object. Let's say I have only access to the FileStream ...
Datcha asked 2/10, 2013 at 9:41
2
Solved
I want to getting session ID to store it in the database (because I store shopping carts in my database). Thereby, I want to get session ID, with this method:
$session = $this->get('session');
...
Soelch asked 25/5, 2013 at 20:30
3
Solved
Given a fixed-length char array such as:
let s: [char; 5] = ['h', 'e', 'l', 'l', 'o'];
How do I obtain a &str?
7
Solved
The following code procedure bytes = parseHexString (createHexString (bytes)) leads to updated of bytes, what I would like to avoid. And as a result calculations are not correct.
<html>
<...
Outpour asked 30/1, 2013 at 11:43
5
Solved
I'm trying to match a word in a string to see if it occurs at the end of that string. The usual strpos($theString, $theWord); wouldn't do that.
Basically if $theWord = "my word";
$t...
4
Solved
I have a string, and I know that it only contains a number.
How can I check if this number is int or float?
4
Solved
I'm wondering how I can remove the first and last character of a string in Rust.
Example:
Input:
"Hello World"
Output:
"ello Worl"
3
Solved
I have a .csv datafile with many columns. Unfortunately, string values do not have quotation marks (i.e., apples i.o. "apples). When I use read_csv from the readr package, the string values are imp...
8
Solved
I'd like to distinguish between None and empty strings ('') when going back and forth between Python data structure and csv representation using Python's csv module.
My issue is that when I run:
im...
5
Solved
I need to load a file given it's name, but the name I get is case insensitive. "A.txt" could actually be "a.txt". How to do this the fast way (not generate all possible names and try each)?
Tristram asked 11/12, 2011 at 6:57
15
Solved
I'm trying to teach myself R and in doing some sample problems I came across the need to reverse a string.
Here's what I've tried so far but the paste operation doesn't seem to have any effect.
The...
© 2022 - 2024 — McMap. All rights reserved.