Skip to main content

Questions tagged [strings]

A string is a sequence of characters. It is commonly used to represent text or a sequence of bytes. Use this tag along with the appropriate programming language being used.

44 votes
4 answers
16k views

In the process of trying to build a serializable data structure, I found myself building large strings, which gets very slow because VBA copies a string every time concatenation is performed. To ...
Blackhawk's user avatar
  • 1,164
84 votes
4 answers
22k views

The following function works well to print out a help message for the program I have written. It prints a multi-line string message that describes the command line usage with some examples: ...
noisy's user avatar
  • 1,001
20 votes
3 answers
3k views

A while ago I implemented .net's string.Format() method in VB6; it works amazingly well, but I'm sure there has to be a way to make it more efficient. I'll start ...
Mathieu Guindon's user avatar
23 votes
5 answers
29k views

Inspired by this question in chat Is there an easy way in .NET to split a string into an array by pulling chunks of the text in. I.e. I have an 18 character string I would like in 3 6-character ...
Heslacher's user avatar
  • 51.2k
44 votes
2 answers
40k views

Given an expression string exp, write a program to examine whether the pairs and the orders of "{","}","(",")","[","]" are correct in exp. For example,...
konijn's user avatar
  • 34.4k
11 votes
1 answer
4k views

I was trying to refactor the following Python code (keeping the same time-complexity) which is an implementation of Z-Algorithm for pattern matching in strings. ...
SohamC's user avatar
  • 221
15 votes
4 answers
3k views

This code was inspired by this question: Number to Words ...
nhgrif's user avatar
  • 25.4k
14 votes
1 answer
4k views

size_t readline_tostring(char * restrict dest, size_t size, FILE * restrict stream) fgets() is OK yet it has some short-...
chux's user avatar
  • 37.3k
13 votes
4 answers
4k views

I attempted a problem from the Cracking the Coding Interview book. The following input: aabcccaaa should give the following output: ...
user avatar
9 votes
3 answers
24k views

(See the next iteration.) I have this small template function for conveniently dumping a sequence into a string such that there is a delimiter between two consecutive elements, and no such after the ...
coderodde's user avatar
  • 34.2k
6 votes
3 answers
1k views

This question is part of a series solving the Rosalind challenges. For the previous question in this series, see Wascally wabbits. The repository with all my up-to-date solutions so far can be found ...
Mast's user avatar
  • 13.9k
6 votes
3 answers
89k views

I was asked in my textbook Lectures on Discrete Mathematics for Computer Science to construct a program that would take an alphabet ({a,b,c} or any combination of ...
user avatar
5 votes
2 answers
447 views

I had a draft for int128 handling reviewed there: int128 handling in c-code, gcc / glibc / linux I changed a lot according to the hints there, while leaving in, e.g., a trailing space on each line, ...
user1018684's user avatar
4 votes
1 answer
2k views

My first algorithm for finding the factors of a number was pretty slow and horrible (it started at \$O(n^2)\$, where n was not even the inputted number), but I eventually came up with this new code. ...
Jamal's user avatar
  • 35.4k
2 votes
1 answer
154 views

This is the second iteration of the Fast search for the longest repeating substrings in large text code review. Special thanks goes to G. Sliepen who conducted the first review. Functional ...
Damir Tenishev's user avatar

15 30 50 per page
1
2 3 4 5
20