Questions tagged [strings]
A "string" is a sequence of characters typically representing a unit of human-readable text. Questions on this topic deal with processing strings in programs, and how various languages and environments define and manipulate strings.
202 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
170
views
Data structure for grouping strings in a collection when they share common substrings [closed]
I am looking for a data structure and an algorithm to manage a dynamic collection of strings, but grouping strings that have a substring in common. I try to describe it through an example.
@Christophe:...
-3
votes
1
answer
275
views
How to find the shortest common superstring [closed]
Problem statement:
You are given an array of strings. Each element (string) of array is of size 2. You are supposed to find the length of shortest possible string such that every element of the array ...
1
vote
3
answers
276
views
To enforce column limits on long strings? [closed]
We're trying to update our style guide (using google's guide as a starting point) and I'm currently in the middle of a debate with my colleagues about column limits. I believe we're all in agreement ...
2
votes
4
answers
331
views
Buggy auto conversion to string : In which code-smell would it fall and how should avoid one?
Consider this Java code:
int rowIndex=8;
int offset=0;
libFuncCall.populate("B"+rowIndex+offset, data);
Here I mistakenly missed the fact that, resulting argument is a String though I had ...
1
vote
3
answers
153
views
How to link many large strings in a maintainable way
I'm developing an app that will work as a troubleshooter. In this, I want to ask the customers only relevant questions instead of giving them an exhaustive list.
Every option they choose will have to ...
1
vote
2
answers
446
views
String representation in Python runtimes
Python is one of the few languages to support a string data type of code points (Unicode Scalar Values). I'm also wanting to creating a language that has this same characteristic, but I need to ...
6
votes
3
answers
1k
views
What is the benefit of caching a hash value in a string object?
I made a patch to a programming language run-time to cache the results of hashing a string in the string object, so that it is just retrieved the next time it is required.
However, I'm not convinced ...
Kaz's user avatar
- 3,692
3
votes
2
answers
386
views
What is the purpose of using strings as identifiers or flags instead of enumerated types?
I have seen in mainly high level languages, but also in lower level languages, the use of option names as strings to specify one of several fixed options, or as flags, or more generally, code using ...
CPlus's user avatar
CPlus ♦
- 1,229
-1
votes
3
answers
392
views
Is there a text distance (or string similarity) algorithm which accounts for the distance between characters?
I'm interested in finding a text distance (or string similarity) algorithm which computes a greater distance (or lower similarity) when characters are further apart.
For example, I want the distance ...
-2
votes
1
answer
633
views
C (Arduino): treat a #defined hex value as ASCII chars [closed]
This is Arduino code, but since it uses C syntax, and it's not Arduino-specific, I thought I'd ask here. I have a few values defined so:
#define PID_RPM 0x0C
Typically it's used as a hex number. But ...
-1
votes
1
answer
1k
views
Will conversion of a string to a list, and vice versa count in time complexity?
Assume that there is a question where a string needs to be passed. Some modification needs to be done on the string and then returned back.
For the programming languages like C where a string is a ...
1
vote
1
answer
161
views
Where's the interpolation in "string interpolation"?
In most contexts, the concept of "interpolation" seems to be related to estimating unknown states from known ones, like video frames or data points.
From the Wikipedia entry on interpolation:...
1
vote
2
answers
366
views
(Algorithm) Maximum Binary String After Making Changes
I am given a binary string binary consisting of only 0's or 1's. There are two allowed operations (can be re-used any number of times):
Operation 1: If the number contains the substring "00",...
3
votes
3
answers
3k
views
Is there a single word for a "non-empty" string?
Take a simple example:
string1 = ""
string2 = "foo"
string1 is empty or null, which is clear.
But what about string2? I wouldn't call it "full". "Non-empty" or ...
1
vote
3
answers
463
views
Algorithm – Number of strings containing every string of a given set a strings
I have a given set S of strings, and a length l, and I am looking for the number of strings of length l that contains every string of S. A naive approach would be to generate every string of length l (...