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.
49 questions with no upvoted or accepted answers
6
votes
0
answers
4k
views
Finding the length of arbitrary ASCII character strings
I have implemented this MIPS code to determine the length of given ASCII character strings.
Is there a simpler way to implement this code? Is there is a built-in function in MIPS?
Given String:
...
6
votes
0
answers
894
views
Parsing Lua 5.2 strings with patterns
I wrote some code to parse Lua 5.2 strings in Lua 5.1, using patterns. It works perfectly as far as I tested.
...
5
votes
0
answers
877
views
A POSIX getdelim() and getline() implementation for MSVC
Tired of always having problems in reading arbitrary length lines from file under Windows, I tried to write a POSIX getdelim() and ...
4
votes
0
answers
88
views
formatting flattened string into JSON-like object in C++, part 2
I have reworked the code from my previous (linked) post.
For reference:
I have a string which contains JSON-like object flattened (stringify()ed).
I need to JSON-...
4
votes
0
answers
69
views
Diagonal square spiral pattern in Vyxal
I wrote this code as a reference implementation for this challenge. How can I make it more readable and/or efficient?
The goal is to take an integer and create patterns like the following:
...
4
votes
0
answers
180
views
SHA256 implemented in Rust
I just finished making an implementation of a SHA256 hashing function (https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf) in Rust and I was looking for some feedback.
As far as I can tell it ...
4
votes
0
answers
77
views
Translating Python to Rust: reading a Salesforce ID from a string
As a first project in Rust, I'm translating an existing, working piece of Python code. This code's purpose is to convert a 15-character Salesforce Id (which is guaranteed to be ASCII, exactly 15 bytes ...
4
votes
0
answers
189
views
Improved Knuth-Morris-Pratt over a source of indeterminate length
Following the successful review of my previous implementation.
Please review my new, generic implementation of the Knuth-Morris-Pratt algorithm. Its modified to search a source of indeterminate ...
4
votes
0
answers
323
views
Advent Of Code 2016 Day 9 Part 1 Solution
This code gives the solution to Part 1 of this question:
http://adventofcode.com/2016/day/9
Summary: You have to find the length of the input string after using the markers to duplicate parts of it. ...
4
votes
0
answers
169
views
Perform a contains-ignore-case with multiple search-tokens
I had a look on Stack Overflow etc. on how to perform a contains ignore case with n given strings. Most answers suggested using regex for this task. Although it's a valid option, I prefer doing upper-...
3
votes
0
answers
284
views
Command line wordle
I am seeking a review of my command line wordle game.
Having only recently started exploring functional programming, I expect that there will be no shortage of areas to improve. This is my first ...
3
votes
0
answers
87
views
Early Stages of floating point class template in C++
I'm currently designing a class template to represent scientific notation or a floating-point number system. There are currently 4 distinct types: BIN, ...
3
votes
0
answers
466
views
Finding differences in strings with Levenshtein distance and soundex
I am trying to find a way to optimize the code runtime. Improvements I have implemented include using dictionaries, removing redundancies and using str.translate.
<...
3
votes
0
answers
114
views
Count number of substrings which contains particular strings
I need to count the number of substrings of s which contains both the strings a and b.
This ...
3
votes
0
answers
256
views
Fastest way to build string feature vectors Python
I have a list of strings to search along with a list of words and want to produce boolean feature vectors indicating presence of each word within the strings. What is the fastest way to build these ...