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.
2,979 questions
3
votes
1
answer
141
views
A string library in C
I've been working on a string library in C with C++ standard features of std::basic_string<char> just for learning purposes. It's called cstring and the full ...
4
votes
4
answers
379
views
Function that searches a substring on an iterable, also with different types of return and ways to search
I was making a program that created several words in a list, and this made me think about trying to create a function that takes the closest words to a certain target, returning all the correct ...
5
votes
3
answers
581
views
A simple but versatile stack-based compile time const string, word and sentence builder utility classes
Foreword
After a couple years of a hiatus from programming in modern C++ going back to C++17, I am staring to get back into the swing of things. I then decided to start work on this nifty little set ...
4
votes
3
answers
535
views
A simple method for compressing white space in text (Java) - Take II
Intro
In this post, I will elaborate on A simple method for compressing white space in text (Java). Here, I have incorporated some advice offered by Chris. Also, this version preserves a single new ...
6
votes
1
answer
581
views
A simple method for compressing white space in text (Java)
(The story continues in A simple method for compressing white space in text (Java) - Take II.)
Intro
Now I have that text space compressor. For example,
...
7
votes
1
answer
310
views
Simple random password generator in c#
A simple random password generator in C#. Looking for any improvements around speed or design. Any char[] can be passed to choose random chars from. The array I ...
2
votes
2
answers
129
views
Checking for weak string isomorphism in Java
Intro
I call two \$n\$-strings \$s\$ and \$z\$ over the alphabet \$\Sigma\$ weakly isomorphic if their character frequency multisets are equal. In other words, for an input strings \$s\$, we derive a ...
10
votes
3
answers
1k
views
Checking for string isomorphism in C++
Intro
This snippet is a translation of the Java version.
Code
string_util.hpp:
...
4
votes
1
answer
198
views
Checking for string isomorphism in Java
Intro
Two \$n\$-strings \$s = \langle s_1 \ldots s_n \rangle \$ and \$z = \langle z_z \ldots z_n \rangle\$ are considered isomorphic if and only if there exists a bijection \$f\$ such that for all \$...
6
votes
1
answer
315
views
Splitting a long introduction into collapsible elements easier to read and translate
Before I started, we had a few long introductory texts that were shown to users in different part of the editor window, depending on what type of object they are editing. The texts describe how to add ...
5
votes
2
answers
121
views
Funny time with DNA: a \$k\$-mer index data structure in Java, Take II
(See the previous and initial iteration.)
Intro
This time, I decided to pack the genomic data such that 4 nucleotide bases are encoded into a single byte. In other words, ...
4
votes
1
answer
120
views
Funny time with DNA: a \$k\$-mer index data structure in Java
(See the next iteration.)
This time I have programmed a simple data structure called \$k\$-mer index. The actual word \$k\$-mer is a synonym of substring of length \$k\$. This data structure is built ...
6
votes
1
answer
431
views
JavaScript Text Summarizer
I wrote this both to help read (and edit/summarize) my own work, but mainly to be able to get through the mounds of papers I was asked to read as a graduate student.
This is a summarization algorithm ...
3
votes
1
answer
142
views
Informal Text HTML & JavaScript Scorer
This is something I've been writing for a paper I'm working on. There is a debate about what is formal text and what is not, but what I know about myself and my writing is that I use certain words (...
5
votes
1
answer
354
views
Multiplying two large numbers whose digits you have in a string, in AEC compiled to WebAssembly
You can see it live here: https://flatassembler.github.io/multiplying-strings-aec.html
...