返回首页
We’re rewarding the question askers & reputations are being recalculated! Read more.

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
1
vote
0answers
11 views

Replacing keywords in strings with sequence of symbols

For an exercise, I have to create a simple profanity filter in order to learn about classes. The filter gets initialized with a list of offensive keywords and a replacement template. Every occurrence ...
0
votes
0answers
21 views

Programatically populate a uint8_t array

I have a uint8_t array which should look like this . uint8_t code[1000] = {0x66, 0xba, 0xf8, 0x03} Now I cant hard code values in that array instead , I need to insert them one by one from char ...
0
votes
0answers
29 views

How to match patterns in one sentence using regex in python?

Here are 2 examples, 1. I need to take this apple. I just finished the first one. 2. I need to get some sleep. apple is not working. I want to match the text with need and apple in the same ...
1
vote
2answers
31 views

Is there a way to include DOT but not a Double Integer in Java Regex?

I have - String prog = "public class HelloWorld {\n" + "public static void main.(String[] args) int b = 0.5 \n" (Here the dot(.) after main in the string is purposeful) Here I need to separate the ...
0
votes
0answers
16 views

Extract set number of characters after specific word in string [duplicate]

I am trying to extract a 'Month, year' substring from a larger string. An example would be: 12345 October, 2019, abc, abcdef although the length and complexity of the strings surrounding the ...
0
votes
0answers
59 views

Is there a way to accept an 'x' amount of strings from the user?

So I am writing a code and I have to accept an 'x' amount of strings (or lines) from the user and save it into a variable. The basic output is going to look like: Enter number of strings: 2 Enter ...
0
votes
0answers
13 views

Parsing XML as a String using InputSource gives empty Document

I am trying to parse XML as a String. No matter whether or not I'm using the response from a RESTful call or a simple string, i get a null Document when i parse it. i have found several posts telling ...
0
votes
1answer
26 views

Ringbuffer with sprintf

I'm trying to create a ringbuffer and fill it with an array of split string elements. Buffer Code is taken from here and works well enough. Here is my main and the buffer implementation: #include &...
0
votes
1answer
37 views

Is it possible to do this regex operation with java in one line?

IS: String: "THE POWER WITH ME/STAR WARS I" There is between 1 and 4 whitespaces randomly. SHOULD: String: "THEPOWERWITHME/STAR WARS I" Delete all whitespaces before "/" REQUEREMENTS: Single ...
0
votes
3answers
44 views

Insert string at particular location on a loop

I have a csv file containing product numbers and I need to insert these into a string which will be later used as a SQL query. I can read and append the values fine but I cant format it correctly. ...
1
vote
5answers
35 views

search array using string and append it into another array of the same format

I have an array of objects array = [ {'Path': '/', 'UserName': 'sns-1', 'UserId': '123'}, {'Path': '/', 'UserName': 'user1', 'UserId': '456'}, {'Path': '/', 'UserName': 'user2', '...
2
votes
3answers
69 views

Adding strings and literals (C++)

In the book C++ Primer I came across the statement: "When we mix strings and string or character literals, at least one operand to each + operator must be a string type" I noticed the following were ...
0
votes
3answers
36 views

Cannot insert special character to a List

Hello I am trying to modify some list ex : text = "charlie's angel" textSplit = list(text) textSplit.insert(6, "\") print textSplit when i try, it results error 'EOL While scanning literal'. As i ...
-5
votes
0answers
37 views

Properties to string and vice-versa in java? [duplicate]

Please, suggest me a most efficient way to convert Java.util.Properties to String and convert this string back to Java.util.Properties. Properties test = new Properties(); ArrayList<Long> test1 ...
0
votes
2answers
57 views

How to convert from a constructor to a string in Haskell?

I am trying to output a hand of cards in string format, but I can't drop the word "Numeric" from the rank of the card, I would prefer to do this without a helper function because it seems really messy,...
1
vote
2answers
30 views

How to store multiple strings in a 2-D array? [duplicate]

I want to write a C program that stores a bunch of sentences while it's running and prints them out at the end of the program. Here's what I wrote: #include<string.h> #include<stdio.h> ...
-2
votes
2answers
50 views

How can I use indexOf for string with “\”? [duplicate]

I have a string with path for file like this for example: C:\Users\Ekaterina\Desktop\3DTrajektorienplaner\Planungstool\Dromedary.stl Now I need only the name of the file: "Dromedary.stl". I have ...
0
votes
2answers
22 views

Python that takes a string and displays that string centered within line_width characters

Hello guys for example; def right_justify( in_str): print("+" * 5,in_str.rjust(11),"+"*5) right_justify("Hello") my function prints out; and why prints out like this? +++++ Hello +...
0
votes
0answers
12 views

Netsuite FreeMarker How to split String and Use the Index

I am new in NetSuite Technical, I am customizing the Invoice and Our Customer is using mix language in their Data Arabic & English together in the same Field, So if I use NotoSansArabic it will ...
0
votes
2answers
36 views

change string in a big list with another string

i have some list as t_pre_eks_tfberita i want to replace the string in row with "Label" string that contain "BUKAN HOAX (1)" to "BUKAN HOAX" and change a string that contain "HOAX (1)" as "HOAX". ...
-4
votes
0answers
40 views

Split String Arrow Function

I'm messing around with this question here: Write a function named getWords that accepts a sentence of words separated by one space, and returns an array of the words in the sentence. Review the ...
22
votes
2answers
472 views

Prevent function taking const std::string& from accepting 0

Worth a thousand words: #include<string> #include<iostream> class SayWhat { public: SayWhat& operator[](const std::string& s) { std::cout<<"here\n"; // To ...
0
votes
2answers
61 views

Getting an error when calling functions inside a while loop in C++

I am sorry in advance if this is a duplicate. I've tried to find a problem that is similar but did not get a solution. I get the following error: "libc++abi.dylib: terminating with uncaught exception ...
0
votes
2answers
35 views

how does stringbuffer/stringbuilder works in memory? how does the stringbuilder.delete function works?

I have appended some strBuild with some characters and putting that strBuild into stringBuildArr. then called the java.lang.StringBuilder.delete(int start, int end) function on strBuild. Here is the ...
0
votes
0answers
24 views

Hebrew string does not display correctly

In a multiplanguage Office Add-In, I need to display in a popup title bar a Hebrew string with a variable injected in the string during execution. No matter what I do, the variable is always moved at ...
0
votes
1answer
46 views

C++ Two user input keywords in the same line plus separate checking

I've been trying to get an if statement to work with two key words. Basically my program will check the first word as the "command" word (like get, set, etc), the one that will trigger the specific ...
0
votes
2answers
49 views

How can I insert multiple values into a list? (python)

In Python, I want to add a space to each string in the list. The result is irrelevant whether it is a string or a list. But I would like to get the number of all cases where there can be spaces in the ...
-1
votes
1answer
31 views

How can I leave the punctuation where it is while reversing a string?

I could use some help. I am trying to reverse a String while leaving the punctuation where it is at in the string. I cannot seem to get this to work. For example the string reads "I like to write ...
3
votes
1answer
46 views

Simple Cipher - Ruby from Exercism

I am currently studying Ruby and have attempted Simple Cipher challenge. I am now studying the following solution and am trying to reverse engineer to understand the thought process behind of this ...
0
votes
0answers
33 views

JAVASCRIPT - Format and use values of a string

So I have a string that is a copy of a table (very similar to this one http://stats.nba.com/game/0021900186/ ) and I want to format it so I can use and compare the values of the players individually. ...
0
votes
0answers
34 views

Using String.format when you don't know how many spaces you need [duplicate]

I need to print out a table in a format such that the next column starts two spaces after the longest word from the previous column. I think I need to use String.format but I don't know how long the ...
0
votes
0answers
13 views

Python 3.7- Input only takes integer, no matter how basic the code

7 and I can't seem to get input to work for anything other than numbers x = input("Hello" ) Just this gives me an error if i input anything other than a number, even floats work but if i put a ...
-1
votes
1answer
27 views

How to convert Counter object dict to string

Is there a way in Python to convert a Counter dictionary into a string? I have tried str(counterobj) method but it's unsupported for Counter (from collections library) Thanks!!
-1
votes
2answers
35 views

How to make the Java to call a String from a XML file(In Android Studio)

I have this code and I will like to make it multi language app. What I want is to use the Strings from the Strings.xml file. How can i change "Colombian Peso" to String. placeHolderData.add(...
0
votes
0answers
7 views

Palindrome Validity Proof of Correctness

Leetcode Description Given a string of length n, you have to decide whether the string is a palindrome or not, but you may delete at most one character. For example: "aba" is a palindrome. "abca" is ...
0
votes
1answer
26 views

Print a line so that it appears in CAPS

I want to generate a line from my code so that it will appear in uppercase. This is the code that I have so far: a= 98 b= 88 c= 78 d = """ I want {} kilos of gram and it want {} kilos of magi also i ...
1
vote
1answer
55 views

while loop for a game in C?

I have a word guessing game which I needs to repeat until the user types Q:. Generally, the answer is in a format A: answer. The game's using sockets! Instead of while(1), I tried using while(buffer[...
-2
votes
1answer
27 views

How to assign char[] to null inside the struct

I m trying to assign null to char name[] inside the struct; however, it not working #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <fcntl.h> #include <...
-2
votes
0answers
18 views

Problem with input and operators in Python [on hold]

I am novice and have a big problem with input. I can´t make convert operators for use input. These operators +, - , /, *. Can you somebody help me? Thank you prvni_cislo = float(input("Zadej první ...
2
votes
0answers
64 views

Comparing Strings C (Socket Programming)

I am making a game where the answer is stored in client_challenges->answer while the client inputs the answer (which is stored in buffer) in the following format: A: myanswer If the answer starts ...
-2
votes
3answers
56 views

C# Split text into Substrings

What I'm actually trying is to split a StreamReader.ReadLine() object such as "1 A & B 2 C & D" into "1", "A & B", "2" and "C & D" substrings. Anybody an idea of a simple algorithm to ...
-3
votes
2answers
37 views

Extract string matching a specific format

Given a QString, I want to extract a substring from the main string input. e.g. I have a QString reading something like: \\\\?\\Volume{db41aa6a-c0b8-11e9-bc8a-806e6f6e6963}\\ I need to extract the ...
0
votes
0answers
23 views

Cannot subscript a value of type '[TestDataModel]' with an argument of type 'TestDataModel'

I cannot seem to figure this simple error out. Any help would be appreciated. Here is the line of code which has an issue, as well as the error message I receive: fun.dataSource = TestArrayData[...
-2
votes
2answers
40 views

how to map array of array of string(Array[Array[String]]) into array of array of double(Array[Array[Double]])?

I have a problem, assume I have an array of Strings Array[Array[String]] = Array(Array(0.1, 0.1, 0.1), Array(0.2, 0.2, 0.2)) and I want to convert it into Array[Array[Double]]. I have tried using ...
1
vote
3answers
48 views

Evaluation Order with string and ints

String s1 = "six" + 3 + 3; String s2 = 3 + 3 + "six:"; System.out.println(s1); System.out.print(s2); Output : six33 6six: Why is 3+3 not added in the first one but is added in the second ...
0
votes
3answers
77 views

Converting Text File into a List <int> (C#)

I am using this link for a starting point. I am completely new to C#, but have experience in C/C++. My goal is to recreate sorting algorithms and have them race each other using forking. I have ...
0
votes
1answer
17 views

iMacros - remove last character in string

I have a string like "673.35." defined as VAR3. I simply want to remove the last "." so I am left with "673.35". It is prooving very tricky for me. Using free verison of iMacros plug in on ...
0
votes
3answers
52 views

Fast and maintainable way of implementing string to integer lookup table

I can find many hits on the question on how to map an integer to a string constant, with the obvious solution char const* strings[] = {"Foo", "Bar", ...}; Now, suppose I want the inverse: I have the ...
1
vote
3answers
42 views

How to match a string of tuples in Java?

I have strings like "(C,D) (E,F) (G,H) (J,K)" and "(C,D) (E,F) (G,H) (J,K)" or "((C,D) (E,F) (G,H) (J,K)". How to return true if regex matches pattern like in first string (which is a one tuple or ...
-1
votes
2answers
39 views

How to write a Python regular expression for split string in this way

I have a string with the following format: CA 'xxxxxx' string string string string CA 'xxxxxx' string string string string CA 'xxxxx' string string string string It's basically a sting that in ...

返回首页
杏彩计划 杏彩官网 杏彩APP 杏彩走势图 杏彩下载 杏彩官方 杏彩网站 杏彩怎么玩 杏彩官方 杏彩靠谱吗 杏彩代理 杏彩骗局 杏彩投注 杏彩倍率 杏彩开奖 杏彩漏洞