Skip to main content
Filter by
Sorted by
Tagged with
-9 votes
1 answer
71 views

I am learning Python and want to reverse a string. Example: Input: hello Output: olleh I know slicing works (s[::-1]) but I want to know if there are other Pythonic or recommended ways to do it. Is ...
Ronit Raj Verma's user avatar
1 vote
1 answer
51 views

I am using Micropython on the ESP32. I have the following string, which includes the unicode character \xb0. a = 'abc\xb0def' First, I will need to change the notation to the \U00XX form, second I ...
Sebastian's user avatar
  • 444
-4 votes
0 answers
53 views

was experimenting with string handling and noticed something confusing. In the following code, two identical string literals behave differently depending on where they are used: s1 = "harsh" ...
Harsh Goyal's user avatar
0 votes
1 answer
99 views

I am new to R and trying to create two new variables from my dataset. My data frame is called netflix and it contains these relevant columns: date_added and duration Example values: date_added: "...
user31963479's user avatar
Best practices
2 votes
8 replies
186 views

I need to define several constant strings that will be used across an entire C++20 project. I am considering the following options : constexpr char[] str1 = "foo"; constexpr std::string str2 ...
Autechre's user avatar
  • 633
3 votes
2 answers
83 views

So, for context, I have started writing a small HTTP-Server for learning purposes. Currently, I have 2 modules: server and logger. The server module uses the logger I wrote internally for logging ...
Puscas Raul's user avatar
Advice
0 votes
2 replies
60 views

I have a problem where I need to cut off text based on a max length. But the inputted string could be html a la <p>hello</p>. the html tags do not count towards the max length. for example ...
Jacob Pecile's user avatar
2 votes
1 answer
56 views

I am using Scala 3.3.7. When I do val str1 = raw"\\\" // compile error: unclosed string literal It is considering the \" as a single character. But when I do val str1 = raw"\\\\&...
Mradul Singhal's user avatar
Best practices
0 votes
2 replies
118 views

I'm quite frustrated trying to write to a binary file in Excel VBA. The issue is with fixed-length string data in a Type structure. (Note that my binary file requirements are that fixed-length string ...
Dave Clark's user avatar
1 vote
1 answer
109 views

How can I handle string values that contain patterns like xxxE205 (e.g., 2004E205), which are used as unique codes in my company? I explicitly read the column as a string in pandas, but values ...
Ethan MK's user avatar
-1 votes
0 answers
37 views

I’m learning Java and testing basic input handling. I wrote the following simple program: import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner ...
Burak HINGE's user avatar
2 votes
3 answers
238 views

I implemented std::hash<std::string> in the usual way, by specializing the std::hash template. But then I realized that these should already be provided by the <string> header (https://www....
luczzz's user avatar
  • 446
-3 votes
1 answer
182 views

I have to create a dictionary, where the keys are letters of the alphabet, and the values are the indexed letters of a given string. Example: Given the string "BDFHJLCPRTXVZNYEIWGAKMUSQO" ...
Shadow0013's user avatar
Advice
0 votes
3 replies
66 views

I'm not yet very familiar with the patterns in Lua's string.gsub function. If I have a string like this: Fishing Lure(+100 Fishing Skill)(1 hour) and I want extract only the string "1 hour"...
user3204810's user avatar
0 votes
0 answers
56 views

I'm using java spring boot and jsoup and recently I upgraded jsoup version to 1.21.1. My code creates search query and searches for it in the document Elements targetElements = document.select(...
user613's user avatar
  • 243
-2 votes
0 answers
57 views

If a list of multiple dataframes (ListA), I can write an excel file doing the following: - write_xlsx(ListA, "Results_Up_Until_20_10_25.xlsx") The problem with this that the date will change,...
Slayer25's user avatar
0 votes
0 answers
81 views

I am trying to use the pymer4 package in python for Multi-Level Models, and I have to pass an "R-style formula specifying the model". I understand that it looks like: target ~ varA + varB ...
n6r5's user avatar
  • 364
Advice
1 vote
7 replies
102 views

I have array of strings $Emails = '[email protected]','[email protected]','[email protected]' This array can contain from 1 to unlimited numbers of elements. And I need to build a filter string from ...
Posix's user avatar
  • 23
3 votes
1 answer
104 views

Demo code: System.Console.WriteLine($"CDbl: {(CDbl("234.56"))} {(CDbl("234.56")).GetType} {(CDbl("234.56")).ToString("0.0")}") ...
kwc's user avatar
  • 339
0 votes
1 answer
92 views

The task Given the following string¹ one ' two 'three four the required function should split it in 3 tokens (one, two three, and four), in agreement with how the bash shell does: $ function ...
Enlico's user avatar
  • 30.3k
0 votes
1 answer
125 views

tl;dr Ideally, I'd want the following "hello world" is split in "hello" and " world" " world" is split in "" and " world" "hello "...
Enlico's user avatar
  • 30.3k
3 votes
1 answer
139 views

I am homebuilding a USB driver on STM32. I have managed to get the device to enumerate which is awesome, but only when I disable all the strings (set all ID's to 0). Right now, when I set ...
Eman's user avatar
  • 303
-3 votes
1 answer
119 views

I want to write a code that finds the derivative to any function and want to take a user input on what type of function they're inputting is. Essentially I tried to write a while loop that only accept ...
Uzair Hafesji's user avatar
6 votes
2 answers
185 views

I'm using the Stringzilla string library, which is supposed to be close to how std::string operates. It has a flag called SZ_USE_MISALIGNED_LOADS. By default it sets it to on, and it looks like this: /...
Zebrafish's user avatar
  • 16.3k
5 votes
4 answers
349 views

If I have a long string: std::string data("This is a string long enough so that it is not a short string"); And then I have a view onto that string: std::string_view dataView(std::begin(...
Loki Astari's user avatar