https://software.codidact.com/categories/44/tags/3339.rssNew Posts Tagged 'string' - Software DevelopmentSoftware Development - Codidact2024-03-22T10:15:47Zhttps://software.codidact.com/posts/291111How can I manage multiple consecutive strings in a buffer (and add more later)?Karl Knechtelhttps://software.codidact.com/users/646562024-03-21T19:15:40Z2024-03-22T10:15:47Z<p><em>This question is inspired by <a href="https://stackoverflow.com/questions/78202169">If I have a char array containing strings with a null byte (\0) terminating each string, how would I add a...https://software.codidact.com/posts/290971A small header-only input output libraryMelkor-1https://software.codidact.com/users/783832024-03-01T09:31:53Z2024-03-09T08:53:58Z<p>The library (inspired by <a href="https://github.com/nothings/stb?tab=readme-ov-file">stb libraries</a>) attempts to provide some commonly used functions (reading a file into memory, determining...https://software.codidact.com/posts/281551How does Zalgo Text work, and how can I prevent my application from accepting it?hkotsubohttps://software.codidact.com/users/530782021-04-29T16:47:36Z2023-12-04T12:54:12Z<p>A <a href="https://en.wikipedia.org/wiki/Zalgo_text">Zalgo Text</a> is something like this:</p>
<p><br><br></p>
<p>T̃͟͏̧̟͓̯̘͓͙͔o̤̫͋ͯͫ̂ ̥͍̫̻͚̦͖͇̌ͪ̇ͤ̑̐͋̾̕i̢͖̩͙͐͑ͬ̄̿̍̚ͅn̵̢̼̙̳̒̄ͥ̋̐v̡̟̗̹̻̜͕̲ͣ̐ͤͤ͒́o...https://software.codidact.com/posts/290093Escape both reserved characters and curly braces in a URI in Spring BootFractionalRadixhttps://software.codidact.com/users/530122023-10-24T13:15:29Z2023-10-26T08:44:40Z<p>I need to pass URI's that contain special characters, using Spring Boot.</p>
<p>The characters include spaces, curly braces (<code>{</code> and <code>}</code>), square brackets (<code>[</code> ...https://software.codidact.com/posts/289251How can I build a string from smaller pieces?Karl Knechtelhttps://software.codidact.com/users/646562023-08-05T16:33:30Z2023-08-08T02:46:05Z<p>Suppose I have some variables like:</p>
<pre><code class="language-python">>>> count = 8
>>> status = 'off'
</code></pre>
<p>I want to combine them with some hard-coded tex...https://software.codidact.com/posts/277930Count the number of occurrences in a text stringpnutshttps://software.codidact.com/users/199442020-09-05T12:59:56Z2023-06-23T00:01:55Z<p>If I have some text in a cell, how can I find the number of times another piece of text appears in it?</p>
<p>For example, suppose <code>A1</code> contains <code>Peter Piper picked a peck of pi...https://software.codidact.com/posts/285946stpecpy(): Design a better string copy function that truncatesalxhttps://software.codidact.com/users/539372022-02-12T23:52:35Z2022-12-10T22:14:28Z<p>I was directed a few days ago to a <a href="https://www.symas.com/post/the-sad-state-of-c-strings">post</a> about a string copy function, which IMO improves the commonly known string copy functi...https://software.codidact.com/posts/285218How to efficiently remove every occurrence of one string inside anotherdumplingshttps://software.codidact.com/users/547102021-12-13T08:15:14Z2022-07-13T07:55:03Z<p>I have two strings and want to remove every occurrence of the second string inside the first one starting from the beginning of the first string and as if each occurrence was removed immediately...https://software.codidact.com/posts/286578array of arrays vs array of pointers to store array of string literalsalxhttps://software.codidact.com/users/539372022-06-11T09:26:11Z2022-06-11T22:26:33Z<p>Let's consider the following code:</p>
<pre><code class="language-c">const char a[][4] = {"aa", "aaa"};
const char *b[] = {"bb", "bbb"};
const char *const c[] = {"cc", "ccc"};
</code></pre>
...https://software.codidact.com/posts/286570Vim: how to search for all instances of a string, except for those that are between two specific stringsTrevorhttps://software.codidact.com/users/542402022-06-10T05:07:27Z2022-06-10T16:55:43Z<p>Using Vim, I am trying to search for all instances of a specific string, except for those that fall somewhere in between two other specific strings.</p>
<p>For example, I want to determine all ...https://software.codidact.com/posts/286304Delete all occurrences of a character in a webpage with vanilla JavaScriptdeleted user#2022-04-23T18:43:29Z2022-04-27T13:06:44Z<p>Primarily for learning, I would like to try to delete a specific character (letter or number or special character), wherever it is in a webpage, with vanilla JavaScript.</p>
<p>The webpage won'...https://software.codidact.com/posts/284935Understanding createTreeWalker method in the context of replacing strings (or parts of them)deleted user#2021-11-21T12:52:37Z2021-11-23T17:08:30Z<p>I want to ensure I understand the following code; <a href="https://www.sitepoint.com/community/t/how-replace-any-occurrence-of-a-word-in-a-document/377844">credit to user:m3g4p0p on Sitepoint</a...https://software.codidact.com/posts/284849Common string handling pitfalls in C programmingLundinhttps://software.codidact.com/users/81762021-11-12T11:09:09Z2021-11-12T11:28:51Z<p><em>Preface: This is a self-answered Q&A meant as a C string handling FAQ. It will ask several question at once which isn't ideal, but they are all closely related and I'd rather not fragmen...https://software.codidact.com/posts/284803Separate digits of a number in groups with different sizessfrowhttps://software.codidact.com/users/546492021-11-08T14:53:36Z2021-11-09T06:07:26Z<p>I have a list of 11-digit numbers stored in one single column in Excel, and I need to separate the digits according to this pattern: <code>2-2-1-3-3</code>.</p>
<p>Example: <code>00002451018</c...https://software.codidact.com/posts/283000How to get string length in D?General Sebast1anhttps://software.codidact.com/users/541142021-07-31T09:52:53Z2021-08-03T14:37:59Z<p>I'm new to <a href="https://dlang.org/">D</a> and am planning to use it for golfing. I want to make a ROT13 converter and I want to determine the length of an inputted string.</p>
<p>Is there a...https://software.codidact.com/posts/282464Input taking only first character of a stringGeneral Sebast1anhttps://software.codidact.com/users/541142021-06-30T05:42:25Z2021-06-30T10:28:31Z<p>I wrote a program named <code>Kernel.c</code> 2 months into my life in programming and created 4 functions at the time, and now there are 7 functions.</p>
<p>Recently, I updated the program com...https://software.codidact.com/posts/277932How to calculate the Hamming weight of a binary string?pnutshttps://software.codidact.com/users/199442020-09-05T16:11:24Z2021-05-26T18:07:47Z<p>A presently <a href="https://stackoverflow.com/questions/58987792/popcount-function-in-libreoffice-calc-number-of-ones">unanswered question</a> on Stack Overflow asks:</p>
<blockquote>
<p>Does...https://software.codidact.com/posts/277259Multiple string concatenation in ExcelJames Jenkinshttps://software.codidact.com/users/363322020-08-13T17:26:14Z2021-05-26T18:05:53Z<p>In Excel I would like to concatenate several strings into one.</p>
<p>I could type and fill in the blanks <code>CONCATENATE(A1, A2, ....)</code> but it is a lot of work</p>
<p>This would be cool...https://software.codidact.com/posts/280933Help me understand why python3 string.format() raises Attribute errorGreghttps://software.codidact.com/users/538202021-02-27T19:09:47Z2021-03-01T06:46:40Z<p>I'd like some help understanding why the third call to print() raises <code>AttributeError: 'NoneType' object has no attribute 'format'</code></p>
<pre><code>from os import path
import inspect...https://software.codidact.com/posts/280201How to override default string formatter?luserhttps://software.codidact.com/users/536942020-12-30T20:46:29Z2021-01-01T11:50:15Z<p>It is possible to create a new formatter class by subclassing <code>string.Formatter</code> class and then to use it like <code>myformatter.format("{foo:customformat}", foo=foo)</code>...https://software.codidact.com/posts/277310What is a standard definition (or a CS theory based formal definition) for Escaping?deleted user#2020-08-17T07:50:22Z2020-10-20T16:49:43Z<p>I personally would define "escaping" in software development in general and coding in particular as follows:</p>
<blockquote>
<p>Making an exception to match data which otherwise would...https://software.codidact.com/posts/278031Is concatenation a logical AND?deleted user#2020-09-11T07:53:05Z2020-09-15T04:42:11Z<p>As a person with no significant background in mathematics and computer science I thought that concatenation and AND are logically identical if not very similar because both add something to some...https://software.codidact.com/posts/277403Does using an Integer have any speed/performance benefits over a string in JSONWelzhttps://software.codidact.com/users/363332020-08-21T00:47:16Z2020-08-22T17:38:37Z<p>I'm working on an API to respond some data about a bunch of orders and items.</p>
<p>The order and item numbers are always an integer (it's the <code>order.id</code> and <code>item.id</code> val...