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

learn more… | top users | synonyms (4)

-1
votes
0answers
21 views

I cant figure out how to print a string from a struct * [duplicate]

// Cargo: what the vessel is carrying struct cargo { const char *title; int quantity; double weight; }; // Define the vessel structure here struct vessel{ char ...
0
votes
1answer
6 views

Copy from char16_t* to char16_t*

I'm trying to copy a char16_t* that's passed into a function but haven't found any way to do that. foo(char16_t* characters) { char16_t* copiedCharacters; //copy characters to ...
0
votes
0answers
6 views

I have a part of a url, I need to put it in another link

[Solved] - I need to resolve the problem below. Please is very important Ok I wasn't really sure how to word this question, but basically what I want to do is, I got a url from a RSS feed in android,...
1
vote
0answers
10 views

store user connections in database (social network like) +add/find/change/delete

I'm working on some sort of social network these days, and I'm wondering how I can store the user connections in a database. The structure I've been thinking of looks like this, and it suits me ...
0
votes
1answer
11 views

Matlab: convert array of number to array of strings, with formatting

I would like to convert a numeric array like this: [12.3134 25.3234 34.4190 466.6765 55.5454] Into a cell array of strings, with a single digit after the decimal point like this: '12.3' '25.3' '34....
-1
votes
2answers
50 views

Get string value, javascript

I'm trying to pass string value as a function parameter, but I need string value inside function Here is the code: EDIT: var array = [{someValue: 5}, {someOtherValue: 10}]; var newArray = []; var ...
0
votes
1answer
25 views

How to detect whether a JSON object is a String or an Array in PHP? [duplicate]

When I have an input like below... { "number":[ "+39XXXXXXXX", "+34XXXXXXXX", "+49XXXXXXXX" ], "message":"Sample msg..." } I handle it with a foreach loop—...
-2
votes
0answers
19 views

removing square brackets and commas but not the commas in the sentence

sentence = input("Please enter a sentence:") words = sentence.split() position= [0] for count, i in enumerate(words): if words.count(i) <2: position.append(max(position) +1) ...
0
votes
1answer
17 views

how to use all the results from an explode an split array in a statement

I am trying to use all the value from a variable keywords (#top #travel #italy) to split using explode() to search in the db and then to show the results. I made a part but it is showing me only the ...
0
votes
0answers
14 views

Tie melted table object back to original dataframe?

I am trying to count the number of times each word in a row in a dataframe occurs at a given time. Here is my dataframe: library(stringr) df <- data.frame("Corpus" = c("this is some text", ...
0
votes
2answers
45 views

Why does program crash for dereferencing pointer to char by using '%s'?

I am learning c, a beginner, can anybody please make me understood which concept am I missing? And thanks in advance. #include<stdio.h> int main() { char s[10]; s[0]='A'; s[1]='B'; ...
1
vote
0answers
29 views

Java String contains not working with string parsed from file

I'm currently facing a string encoding problem. ListItemType liste = new ListItemType(); String toBChecked=(String)table.getValueAt(row,0); System.out.print(toBChecked); toBChecked = "...
1
vote
2answers
32 views

Julia - Trim string whitespace and check length

I'm new to Julia and I was wondering if there were any built in functions for trimming string whitespace? I also want to check the length of the string which I know I can do with length(s) == 0, but I ...
0
votes
0answers
29 views

all strings are printing on the console at the same time in assembly language 8086

I am having a problem with my assembly code I was making a linear search program and in that program i have initializes two strings; the string when user is asked to input a number and other when ...
0
votes
1answer
41 views

How to restrict users to input only text but not numbers?

I'm making a program to input book detail using struct and function. Here is my declare using struct to manage book detail: typedef struct { char name[100]; char author[100]; char ...
1
vote
1answer
60 views

Anagram detection method c++. Problems converting string to ascii value

For anyone that might be able to help me figure this out. I am creating a method that will compare two strings and detect whether they are an anagram or not. An anagram is two strings that have the ...
-2
votes
4answers
46 views

A Program that Checks Consecutive Letters - Java

I'm looking for help with a question I have. We just started learning simple java in our course after learning a tonne of C++. One of our bonus missions for people who know code more than what was ...
1
vote
1answer
17 views

String to np.matrix back to string

I read a string data from a TCP port and it looks like this: data_string = '1,1.0,2.4,4,3,0.0,0.0,0.0,7,-2.5,80,1481307702.180;2,3.3,10.1,2,2,0.0,-0.0625,-0.25,7,-20.0,3,1481307702.180;3,-0.2,1.5,4,4,...
0
votes
3answers
72 views

What is wrong in my C code for a program about strcmp()?

I am writing a program for comparing two strings without using strcmp(). But, am unable to get my desired result. Here is the code for my program. #include<stdio.h> int main(int argc, char ...
0
votes
2answers
13 views

DFA that accepts even number of 0's and odd number of 1's

The question I have been asked is "Design a DFA accepting the set of all strings with an even number of 0’s and an odd number of 1’s on the alphabet {0, 1}." I've tried this a few different ways but ...
0
votes
2answers
31 views

Changing a string into the name of a button

Im trying to figure out how to change a string into a name of a Button. For example if I had the string self._name = 'self._prentice', I would like to make self._prentice = tk.Button(master). I need ...
-2
votes
1answer
37 views

Finding Position of a word in a string

I’m trying to develop a program that analyses sentence with several words in a string. When a word in the sentence is inputted the program should identify all the positions that this inputted word ...
0
votes
0answers
13 views

Conditional Logic with Strings “std::out_of_range” in C++ 11

I am trying to make a small password Hash creation program that turns the password (string) into a hash version. I am using vectors to hold the Hash values. I keep on getting the "std::out_of_range" ...
1
vote
2answers
33 views

Test whether a string contains a literal asterisk

Basically looking for a string that contains an asterisk, looked all around for one that relates to an until loop but to no avail! e.g. the user would basically keep typing in strings and the program ...
-3
votes
0answers
25 views

How to split a text on the double 0x00 and stop reading when getting tripple 0x00 in c++

I'm new to c++. I want to split this string. The string contains data which needs to be split-ed firstly in to two then some data replacement will be done. The problem is that the data is separated by ...
1
vote
4answers
81 views

How to compare 2 statements in java

Is it possible to compare 2 String like this. String test1 = "foo bar abc"; String test2 = "bar abc foo"; Typically is not a String equals in java. I'm thinking to use ArrayList or array by ...
0
votes
3answers
53 views

Swift enums: Getting enum value for string enum from int value

We are using enums for some basic data structures like this: enum Industry: String { case Industry1 = "Industry 1", Industry2 = "Industry 2", Industry3 = "Industry 3" static let allValues = ...
1
vote
3answers
26 views

n-level nested tuple data to comma separated string with surrounding quotes

I have below string: companies = [(('Paramount Pictures Corporation (Canada)',),), (('20th Century Fox Home Entertainment',),), (('Shanghai Epic Music Entertainment',),), (('Paramount Pictures',),), (...
-3
votes
2answers
51 views

How to divide a sentence to words and compare with another string?

I have saved the units in .txt file. These I am getting in an array list. Now I want to check if any of the units present in the string. List contains : "units", "kg", "kilogms", "kilo", "literes",...
0
votes
1answer
20 views

Replace a different and many characters or word's to single word in multiple Java files in different scenarios

Need to replace 2000 different words into single word i.e "ex". in java files. For Example: catch (Any_Exception qq) { logger.error("error message", qq); } above scenario should be as below : ...
0
votes
1answer
33 views

Python How to print the text read from a file without the escape char?

The python code is like this. I try to read the data from a file. But when I print it I get the output with square bracket and escape char. If I just print the content which I copy from the data file. ...
0
votes
0answers
19 views

Mainpulating a QObject created from a button press

I am making an application, and at some point, the user will be creating some sort of from/survey. When creating, the user selects the various question types etc. by pressing a button and a new object ...
1
vote
0answers
49 views

Find Possible Original String From the Shuffled String

I have a problem. Here is the description. Distance between 2 strings is the sum of absolute difference between the letters at same positions (e.g. difference("ab","cd") = abs('a'-'c')+abs('b'-...
0
votes
3answers
57 views

C++ display map that has vector

std::map<std::string, std::vector<string>> data; In order to print out this by using copy, how should my std::ostream_iterator be? Apparently std::ostream_iterator<std::pair<std::...
0
votes
2answers
37 views

Print hexadecimal code from int into string

I need to save a string with the hexadecimal code of an int. For example the hexadecimal value for the int 15 is xoooF. My problem is that I have to save this code in a string like this: int myint =...
0
votes
2answers
21 views

Python 2.7: find integer strings in file using regex & add them: invalid literal for int() with base 10

I'm trying to read a .txt file (data is ASCII textbook material stuff) with strings of numbers scattered throughout the file. I'm trying to extract those numbers to tag them to a list using regex and ...
-1
votes
3answers
59 views

Write a file in c of an array of integers with fputc

I'm writing a program that reads a file and generates an array of integers of each byte, first I prove with a .txt file and I generates the ASCII for each of the letters and its corresping byte(for ...
0
votes
1answer
7 views

Why is my code only printing my method and not continuing with the rest?

I'm supposed to ask the user to enter a bagel code, ask if they want more, and an output file should be made, but none of this happens, the only thing that happens is the printMenu method. This is my ...
21
votes
3answers
2k views

Why is it not a compiler error to assign to the result of a substr call?

I just discovered the most baffling error and I don't understand why the compiler did not flag it for me. If I write the following: string s = "abcdefghijkl"; cout << s << endl; s....
0
votes
2answers
29 views

Java Array to String with comma between elements [duplicate]

first, i got an array String[] array; array[0] = "one"; array[1] = "two"; array[2] = "three" i want to make this array into a String like this: "one,two,three", so i did something like this ...
1
vote
0answers
38 views

HashMap with custom keys, equals() and hashCode() [duplicate]

I'm trying to implement a HashMap with custom key values. This need was raised by the fact that I need to use String as KEY, however, I need the .equals() to be different. In fact, I use an ...
0
votes
4answers
31 views

Python: Split a string into a list, taking out all special characters except '

I need to split a string into a list of words, separating on white spaces, and deleting all special characters except for ' For example: page = "They're going up to the Stark's castle [More:...]" ...
1
vote
2answers
20 views

How to get itertool.product to generate strings instead of list of chars and then brace each string with additional strings?

I don't know much about python data structures but basically I'm generating all permutations of letters : import, itertools, string k = itertools.product(string.ascii_lowercase, repeat = 2) list(...
-3
votes
0answers
15 views

Convert a list stored in a string in a list [duplicate]

I have one variable: list_str = "[1,2]" and I want to convert list_str to a real one: new_list = convertToList(list_str) print(new_list) print(type(new_list)) [1,2] If you have some ideas :) Of ...
-1
votes
1answer
27 views

Split .txt file into words and store each word in array [on hold]

Let's say my file has about 1000 words with commas, dots and semicolons. I have to split the text into words (probably using "strtok", but I don't know how to do this correctly) and then write these ...
-1
votes
0answers
20 views

MIPS Runtime exception at 0x00400218: address out of range 0x0000003f

I have a bug with a program I've wrote. This program asking user input a sentence , then it prints how many words, how many non-space chars and the longest words in that sentence etc. The bug I'm ...
0
votes
3answers
48 views

How to get an Arraylist<String> after using List and LinkedHashSet to remove duplicate values from a string in Java

This is part of a homework assignment, a search engine. I am trying to make a class that removes duplicate values from string input (input will be taken from user, using a random String now for test) ...
-6
votes
2answers
51 views

Compare 2 strings in C and print equal part [on hold]

How can I compare 2 strings with maximum length 100 and print the equal part of them, like: STRING 1 : ABCDEFGHIJKLMNOP STRING 2 : QWERABCDZXVBERTY The equal parts of these strings are : ABCD
1
vote
2answers
51 views

Generating expressions from permutations of variables and operators

So, I've decided that it's time to learn regular expressions. Thus, I set out to solve various problems, and after a bit of smooth sailing, I seem to have hit a wall and need help getting unstuck. ...
1
vote
3answers
32 views

Octave - Adding '\n' to String Array is Not Creating a New Line

I want to change ',' character to '\n' and save it to the text file All files are in this format: 546,234,453,685,.....,234 I want to make it like: 546 234 453 685 ... 234 My initiation to ...