Skip to main content

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.

1 vote
1 answer
190 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:...
differentrain's user avatar
-3 votes
1 answer
292 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 ...
letitbesb's user avatar
1 vote
3 answers
307 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 ...
Zachary Coffin's user avatar
2 votes
4 answers
350 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 ...
MD. Mohiuddin Ahmed's user avatar
1 vote
3 answers
171 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 ...
scidhuv's user avatar
  • 29
1 vote
2 answers
475 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 ...
Hydroper's user avatar
  • 121
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,702
3 votes
2 answers
408 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
  • 1,219
-1 votes
3 answers
431 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 ...
Vermillion's user avatar
-2 votes
1 answer
663 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 ...
MrSparkly's user avatar
-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 ...
Rishi Agrawal's user avatar
1 vote
1 answer
174 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:...
NPN328's user avatar
  • 218
1 vote
2 answers
405 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",...
Arunima's user avatar
  • 37
4 votes
4 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 ...
Lou's user avatar
  • 366
1 vote
3 answers
478 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 (...
jthulhu's user avatar
  • 141

15 30 50 per page
1
2 3 4 5
14