Questions tagged [string]

A string is a finite sequence of symbols, commonly used for text, though sometimes for arbitrary data.

Filter by
Sorted by
Tagged with
-2 votes
0 answers
16 views

Javascript replace regex wildcard with dynamic text

I need to extract text but some parts are dynamic and change This is my var htts://query1.data.site.com/v7/finance/download/MYTEXT?period1=1664641287&period2=1696177287&interval=1d&events=...
cicoria's user avatar
  • 27
-1 votes
0 answers
16 views

Java will not store a user input as a string [duplicate]

I'm working on a Java project where we prompt the user for a seed, store it as a variable, and then prompt the user for a password, and store it as a string before moving on to create a Salt password. ...
Jenn Frannee's user avatar
0 votes
1 answer
44 views

Python: how many substrings in the given string contain given subsequence in time O(n)

The task is to calculate how many substrings in the given string contain the subsequence "tira". We need to find solution in time O(n). I have been trying to do this problem all day now and ...
jdbbgkjnd's user avatar
0 votes
0 answers
17 views

why this error type 'String' is not a subtype of type 'Map<String, dynamic>

have been in this situation for a long time now without a soluction to the error 'String' is not a subtype of type 'Map<String, dynamic> have been making a lot of related question also hope to ...
Eniedi Monday's user avatar
1 vote
1 answer
21 views

reversing string with reversed function, print shows memory location but not the string

I am reversing string with reversed function, of course I asigned to variable when I print it, shows memory location but not the string value user_input = "12345678" reversed_odd_digit_sum = ...
manoj's user avatar
  • 19
1 vote
1 answer
33 views

Why does Python return -1 for string.rfind(last character of string, 0, len(string) - 1)?

For Python str.rfind(sub[, start[, end]]) method, I think these are the default values for the start and end parameters: start = 0 end = the index of the last character of the string, which is ...
bowls-pellets's user avatar
-1 votes
1 answer
25 views

Get string between starting and ending between hash value example: #insidehash# will be insidehash

I have long string and I need to extract subsrting which will start and end with # in c sharp For example: #insidehash# Substring will be: insidehash I am looking solution for the above problem I have ...
vijay.malhi's user avatar
0 votes
1 answer
17 views

How to make string math calculation to be calculated in Twig

I have string like "((2*160)+53)*1.00000" which I recieve in data into Twig template. How to make calculation work and return the calculed number, not the plain string of the math? So ...
Viv's user avatar
  • 25
-2 votes
1 answer
53 views

String replace in python confuses . with E? [closed]

I am trying to remove all "M. " that appears in the beginning of a column. This is supposed to be easy. Here is my code: df['name'] = df['name'].str.replace('M. ', "", regex=True) ...
MG Fern's user avatar
  • 117
0 votes
2 answers
30 views

How to get a String from an xml file when using an object in Jetpack Compose?

Instead of direcly write "red", "yellow" and "green", I would like to get the string from xml. object Apples { val apples = listOf("red", "yellow",...
Mister Propre's user avatar
0 votes
3 answers
68 views

Extract required values from a text corresponding to given string matches

I have the following string. ******************************************************************************* * * * ...
mark's user avatar
  • 83
0 votes
1 answer
20 views

how can i convert a string to a list to index using a for loop in lua?

i'm trying to make a roblox game and i need a gui that shows text character by character but it just shows numbers this is my code local frame = script.Parent.Parent local currentText = "" ...
MyNameIsNotBob's user avatar
2 votes
0 answers
22 views

MIPS Reversing strings separated by newline characters

I am trying to reverse string separated by newlines, without moving the positions of the newlines. I used a stack and my use of the stack is appropriate, however I keep getting a bad address in data/...
Fhatuu's user avatar
  • 21
0 votes
2 answers
60 views

Getting a custom iterator to work in Rust over a &String

I am currently working on implementing a iterator which splits the given string and returns the substrings as an iterator. For a special character it is going to return just the special character or ...
will the wise's user avatar
-1 votes
0 answers
19 views

Azure keyvault access in a multi-tenant environment

we are looking on building a multi-tenant application where the webapp is common but there will be a database per tenant. The goal is to have an Azure Keyvault containing all the connection strings to ...
Kjell Moens's user avatar
-1 votes
0 answers
40 views

How to Resolve a Runtime Error in a String Compression? [closed]

I'm encountering an issue with this LeetCode question: String Compression. My code passes all the default test cases without any problems. However, when I attempted to submit it, I encountered a ...
Ehtesam Zunnuryn's user avatar
0 votes
0 answers
80 views

why js is faster than c. why js faster calculates strings [duplicate]

why this performs faster in js than in c console.time("done"); let x= "baobab"; for(let i = 0; i < 999999999; i++) (x = "baobab"); console.timeEnd("done"); ...
Olgierd Kowalewski's user avatar
1 vote
1 answer
78 views

in C, when I print string without '\0', why are Chinese characters printed, not ASCII?

Why does printf("%s") print out Chinese characters? char str[5] = "Hello"; printf("%s", str); When I run this code, I got "Hello儆儆儆儆儆儆儆儆儆儆儆?". I think the ...
minyong kw's user avatar
-1 votes
1 answer
65 views

I'm trying to make a static string class [closed]

This is just for fun, I know i can use the std and not reinvent the wheel, etc. This is essentially my class: template<size_t size> class sstring { public: char buffer[size]; }; I want to ...
Dain's user avatar
  • 21
0 votes
2 answers
52 views

Add a common string prefix to elements in DataFrame column to get pre-defined string length

I have an example DataFrame: df = sample_id data_sample 1 0.9 12 0.4 178 0.8 300 0.2 I'm trying to make a new column, sample_id_full ...
MAtennis9's user avatar
  • 127
1 vote
1 answer
41 views

Use Powershell to extract PEM file lines add quotes to beginning and end and make it one line

How do I take the contents of a .PEM that looks like this: -----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ6AMIIBCgKCAQEAse68c1suNUQr0d79VudK XgmNxggQoaqR9fZoCrUz/...
Juan M's user avatar
  • 11
0 votes
1 answer
16 views

How to assign text to string from an XPath that contains text() function using selenium?

I am trying to assign the string text value retrieved from a XPath that contains "/text()" function. However, when I try the selenium method "GetText()" & "GetAttribute()&...
C_Sutt's user avatar
  • 193
-3 votes
0 answers
54 views

Why won't the 2 byte values in my table combine into an Integer value [closed]

So, just as a preface, I am not well versed in coding, and I am just beginning to learn. I'm working on a personal project and I'm trying to take raw data that I get from a data collection unit and ...
CyclopianVulcan's user avatar
1 vote
1 answer
42 views

I'm having trouble swapping the strings in an array in Linux x86_64 assembly language

I want to implement bubblesort and quicksort in x86_64 assembly language on Linux, but I'm having a lot of trouble. I can't get a basic swap routine (swapij) to work. Any help would be greatly ...
jschwartzman's user avatar
0 votes
0 answers
19 views

str_replace_all doesn't replace any [duplicate]

I am cleaning up some pdfs. The hope is to do minimal copy-pasting but I'm stuck on the first bit. I can't believe there isn't a quicker version of Ctrl+H to replace all in R. What am I missing in ...
ibm's user avatar
  • 774
-2 votes
1 answer
46 views

How to Change The Case of Array Values [closed]

So I had a requirement to title-case the values of an array (not the keys for which there is a function). I searched and since a solution could not be found, I am going to post my result. $data = [ ...
DanimalReks's user avatar
0 votes
0 answers
7 views

How to sync 2 or multiple node in ros2?

class Combine(Node): def _init_(self): super()._init_("combine") self.subs_hello_ = self.create_subscription(String, '/hello', self.callback_msg_hello) self....
Mr. x's user avatar
  • 15
0 votes
1 answer
54 views

warning: passing argument 1 of ‘strcmp’ makes pointer from integer without a cast [-Wint-conversion]

#include <stdio.h> #include <string.h> int main () { int i, containizioa,lenstringa; char stringa[20], stringhemin3[20], strG[30]; containizioa = 0; for (i = 0; i < 7; i+...
Vitaliano17's user avatar
1 vote
0 answers
19 views

What is the difference between pd.ArrowDtype(pa.string()) and pd.StringDtype("pyarrow")?

From here we can read: https://pandas.pydata.org/docs/user_guide/pyarrow.html The string alias "string[pyarrow]" maps to pd.StringDtype("pyarrow") which is not equivalent to ...
Ziur Olpa's user avatar
  • 1,849
0 votes
0 answers
14 views

Error Cannot invoke "String.isEmpty()" because "parent.path" is null for mockk kotlin datastore functions

I am writing a Test class using mockk framework of koltin for data store. The class looks like `open class MyStorageClass(context: Context) : Storage { private val testDataStore = context....
Satyam Gondhale's user avatar
0 votes
2 answers
49 views

vb.net code to divide the strings as required

I am totally new to string programing and trying to develop a program in VB.Net wherein I am unable to differentiate Students and Lecturers from a single Field. Sample Data in Field TextBox1.Text= &...
Rajesh's user avatar
  • 3
-1 votes
1 answer
41 views

Empty line at the end of code needs removing

I have this method that returns a string where a triangle appears on the left size of the diagram, followed by horizontal lines. I used a stringBuilder for this method. The problem is that there is an ...
George's user avatar
  • 1
0 votes
1 answer
57 views

String is truncated when I read data using Pandas library

I have a dataframe in .csv format. I have a column which has some cells that have data in a string which is very long (upto >5000 characters). When I read the data from that cell, I noticed that ...
Willy's user avatar
  • 1
0 votes
1 answer
36 views

Names being entered by the user during a for loop are overwriting themselves in C

I am trying to write a program in C that allows the user to enter names until they input the word "done". Then it will list out all the names they have entered. I understand I should use an ...
Carsdan Dvorachek's user avatar
0 votes
2 answers
34 views

How to always count all overlapping substrings in a character string?

I have a character string variable that represents subject’s mood over time as 1,2 or 3. As an example, it could look like this: Subject Mood Albert 112132 Betty 111213 I need to understand in how ...
Alex's user avatar
  • 1
1 vote
1 answer
69 views

String length comparison to an integer seems to return wrong answer

I'm working on a LeetCode problem (880. Decoded String at Index) where I need to decode a string following specific rules, and I've come across an issue that I don't understand. I'm using a loop to ...
Tumasotis's user avatar
0 votes
1 answer
75 views

Rust println! result is different that print! when using time::sleep [duplicate]

Ok, so I haven't worked with Rust for that long so sorry if this is dumb. But I'm trying to make a print function that takes in a string and then prints the string character by character on the same ...
TechFishe's user avatar
-1 votes
0 answers
44 views

Filter word out of string [closed]

You get a string of unknown length. You get it character by character using function getchar(). You have access to function putchar(c) which prints out the character c. You get a word of length N. You ...
OceanClouds's user avatar
1 vote
2 answers
61 views

Adding letter to a string vector in R

Disregarding the hashtaged lines in my input, is there a way to add: A* before "alphanumeric" elements that don't have a * prefix and appear after ~ and R* before "alphanumeric" ...
Simon Harmel's user avatar
  • 1,029
0 votes
1 answer
27 views

How to Detect Missing String values for specific groups in a Long-Format Dataset in R?

I'm working with a long-format dataset in R where I have multiple groups and a column of strings denoting season (fall 2020, winter 2021, summer 2021, fall 2021, etc.). I expect each group to have ...
Christie's user avatar
0 votes
2 answers
23 views

spoof randomly screen resolution at every browser startup (javascript - violentmonkey)

I want to randomly execute a bunch of strings within the same script. I'd like to run it randomly so that I get a different screen resolution every time I start the browser, instead of being stuck at ...
Obey Rush84's user avatar
-2 votes
0 answers
49 views

Transform a list of strings into 1 string with new lines between successive elements of the list in groovy/java without using a loop for efficiency [closed]

I have the following code in which componentList is a list of strings String text = "The super feature " + issue + " will be split into " + componentSize + " features, one ...
Mouna Camelia Hammoudi's user avatar
0 votes
1 answer
32 views

Return string from a void method that contains winappdriver

I'm trying to create a code with loops from some strings to get a text and I need to "return" the string I get in the else if(select == "t")... how can I do it?? Part of the code ...
Alexandre's user avatar
-1 votes
5 answers
50 views

Python, re module, finding patterns [closed]

I receive strings of a pattern like this: "<numbs and upper and lower case letters and _'s>(<numbs and upper and lower case letters and _'s>).<numbs and upper and lower case ...
IvanZharov's user avatar
0 votes
1 answer
51 views

Find the number of substrings of this string that start and end with different characters

Find the number of substrings of this string that start and end with different characters. If the same substring appears multiple times in S, it is to be counted multiple times. What approach should i ...
Akash Anand's user avatar
1 vote
2 answers
33 views

Find location of a character and write location to a data frame in r

Suppose this dataframe: col1<- c('a_b_c_fv', 'ff_g1_h_fv','e_ii_jjjj_fv' ) df <- data.frame(col1) Want to find the location of the third occurrence of the underscore _ and then write that ...
Log On's user avatar
  • 81
1 vote
1 answer
34 views

What is the solve for "Strings nested within an f-string cannot use the same quote character as the f-string prior to Python 3.12 Pylance" in vscode?

I am a begginer python programmer and I got a problem while making a programme which is: "Make several dictionaries, where each dictionary represents a different pet. In each dictionary, include ...
sakibmouin's user avatar
0 votes
2 answers
78 views

Storing different functions under one function pointer

Please allow me to provide some background to my problem: I have a university assignment that provides me with a class named StringList. This class is responsible for a lot of string operations such ...
Default's user avatar
  • 83
0 votes
2 answers
40 views

How to iterate through text file with whitespace and newlines, perform a function upon each string, and print out again in the original format?

I need to go through a text file in a similar format as follows: fire dwarf stone rock beer arrow lion sword shield archstone dragon gold silver hall goblet chest axe Axe has a newline after it("...
user20125552's user avatar
1 vote
1 answer
48 views

.net 6 converts negative decimal number to currency different from .net48

I have a method that converts decimal to string currency public static string ToCurrencyWithParentheses(this decimal initDecimal) { return initDecimal.ToString("C", CultureInfo....
Anatoliy Denisenko's user avatar

1
2 3 4 5
3671