184,846 questions
5
votes
2
answers
234
views
How to embed a const char in a const string?
Consider the following two lines of code:
const char c = 'a';
const string s = "" + c;
The 2nd line is giving me error CS0133: The expression being assigned to 's' must be constant.
...
Best practices
0
votes
8
replies
165
views
Best ways to concatinate strings in python
I was writing code for naming image file with parameter values in python.
Here, parameter_list holds values of each paramter in float and function_name means the name of functions that transform the ...
Best practices
1
vote
15
replies
251
views
How do I properly handle UTF8 encoded CSV files
I have code that imports spreadsheets of 2 columns of numbers for a scientific application.
While creating some test files with excel, I inadvertently created one with "CSV UTF-8" encoding. ...
Advice
1
vote
2
replies
90
views
in Dart why does String start with capital letters and not the other types
in java the primitives types like int, boolean, double,... are in lowercase and String is an object that's why it start with a capital letter(from what I know). But why is it the case in dart, ...
Tooling
1
vote
7
replies
163
views
Check if String only contains latin letters including accents
I want to check if a String only has latin letters (a-z / A-Z), but it may also contain letters with accents (á, à, ã, â, é, è, etc). What is the best way to do this?
If possible, I'd prefer to use ...
-4
votes
1
answer
174
views
A Rust statement I'm reading is difficult to understand for me. Can you explain it?
I'm trying to understand why an OpenAPI generator produces the wrong Rust source.
For that, I first have to understand the statement I'm looking at (I cannot test it, as it is inside a block that ...
0
votes
0
answers
109
views
String variable output contains characters that could not be displayed [duplicate]
I have a PHP variable which looks like this:
$news="Do you have a business idea and want to evaluate its market potential? The Fédération des Entreprises Russes (FER) organises a practical ...
Best practices
0
votes
16
replies
129
views
Creating a list of mutable strings
I want to have a management wrapper to a collection of mutable strings. A std::vector<std::string> as a member variable came to mind.
Creating an entry in the list with vector.emplace_back() and ...
Best practices
3
votes
1
replies
145
views
How do people handle naming for path strings versus path objects?
In any program, module, or object, one might need or encounter a file or folder path or partial path as a string or as an object, e.g. a pathlib object. Do you use a naming convention for ...
0
votes
1
answer
220
views
Why does a non-match on an empty string with PHP's sscanf() return -1 instead of 0?
I ran into a bug in my code today when I null-coalesced a submission value to an empty string which was being validated and sanitized by sscanf(). My coding intention was to only call a method when ...
0
votes
0
answers
49
views
Column type becomes "any" after string concatenation — can't convert back with string() or replaceColumn
I'm running into a type issue while constructing stock ticker symbols. I have a market suffix dictionary, and I concatenate each stock code with its market suffix:
stockCode = symbol(`000001`600001`...
0
votes
1
answer
56
views
Oracle regexp finding text after a specific string
How do I return the text between the single quotes in an Oracle VARCHAR field.
The field contains the text pattern below. I need to find the string PTYPE=> and then grab the text between the quotes....
Advice
0
votes
2
replies
62
views
String from list's values in functional programming
I'm new to functional programming, and I'm trying to write a function that takes a list (of indeterminate size) of values and return a string of a formatted version of each value.
For instance (in ...
Advice
1
vote
19
replies
288
views
Are lookup tables for case-converting, ASCII only characters [0,127] faster than arithmetic operation?
Imagine I have a long string 10 kb characters, filled with random ASCII characters.
And I want to lowercase them. One way i could do that is by using a simple operation like:
inline char lowercase(...
Advice
0
votes
10
replies
169
views
how to implement multiple search functions in c for a string library
I've been working on a string library in C(just for learning purposes). It's called cstring and the full source is here.
I use _Generic with function macros so you can call the same function name with ...