Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [string]

A competition to solve a particular problem through the usage and manipulation of strings.

Filter by
Sorted by
Tagged with
1
vote
3answers
148 views

snakes_are_bad, camelsAreBetter [duplicate]

Introduction All these snakes everywhere! I've had enough, and have decided that I much prefer camels. Therefore, I want you to convert my snakes to camels for me. Challenge Turn any ...
22
votes
40answers
8k views

Make me speak L33T

I want to be down with the kids of the 1990's and start speaking this L33T speak of their's. For any given input I would like the resulting L33T speech as an output. I don't want to go to far down ...
19
votes
9answers
2k views

Substitute Unprintable ASCII Characters

Sandbox Have y'all ever written an answer with unprintable ASCII characters in it and wished that there was an easy way to represent those characters in a printable way? Well, that's why the Control ...
21
votes
14answers
2k views

ASCII texturing

Write a function or a full program that applies an ASCII texture to a 2d shape. Inputs: shape, texture, dimensions(optionally). Both Shape and Texture can be given by any convenient method (2d ...
24
votes
34answers
2k views

Sort and Table a Sentence by Word Lengths

In as few bytes as possible, sort the input, a delimited string OR list/vector/array of words, words contain printable ASCII except space (ASCII values 33-126) into a numbered list, table, or ...
10
votes
2answers
375 views
+100

Exploding Primes

At the time of writing this puzzle, there are soon to be 269 puzzles related to primes. To celebrate/mourn this event (269 is prime), this challenge will be about exploding primes. In preparation for ...
2
votes
0answers
60 views

Counting syllables [duplicate]

Challenge Write code that, given an English word, outputs the number of syllables it has. Scoring will be determined by a combination of code length and accuracy. Rules The accuracy of the ...
15
votes
5answers
3k views

Format a Swedish phone number

In some parts of the world, phone numbers are fixed-length, apparently. That sounds boring, though. For this challenge, your task is to take the digits of a what is presumed to be a valid phone ...
1
vote
5answers
221 views

Proportion of strings with ascending letters [closed]

Challenge Construct n strings, each with three distinct letters, chosen randomly with equal probability. Print the proportion ...
14
votes
54answers
3k views

Average Two Letters

Introduction Every letter in the English alphabet can be represented as an ASCII code. For example, a is 97, and ...
30
votes
12answers
2k views

What is my volume?

Given an input integer, output the volume corresponding to the value. The value will always be in the range \$[0,100]\$. Examples If the input \$=0\$: ...
27
votes
12answers
4k views

Identify the Eeveelutions

Gah! It's a shame that Pokémon Sword and Shield won't introduce a new eeveelution. Let's mourn them with a code golf. The objective is to, when given a type name as the input, output the name of the ...
-5
votes
2answers
211 views

Fastest N times Hello World (Java/C/ C++) [closed]

Not a new one: Input N, being n, 0 ≤ n ≤ 5. Output N times "Hello World." Example: Input 3 Output Hello World. Hello World. Hello World. These 2 are my ...
13
votes
22answers
4k views

Making Sandwiches

Introduction Bob runs a deli. His deli serves sandwiches to its customers. However, it is a bit unusual. At Bob's deli, instead of telling Bob what they want, customers show Bob an ASCII art drawing ...
18
votes
16answers
3k views

Check the validity of a 10-digit telephone number

Your task is to write a program or function that checks if a string is a valid phone number. Given a string (or list of characters/codepoints) input, you will output a truthy value if the input is a ...
10
votes
3answers
347 views

Translate a simple sentence from Toki Pona

Toki Pona is a linguist's code golf: A minimalist language with a vocabulary of around 120 words. Because of this, it has very few grammatical irregularities found in other languages, making it ideal ...
14
votes
8answers
783 views

ASCII Pumpkin Carving [duplicate]

Today is Halloween and it's time to carve some pumpkins! & ((^.^)) Given an input integer, string, list of integers, etc., output the corresponding ...
45
votes
24answers
9k views

Cheat at Rock-Paper-Scissors-Lizard-Spock

When playing Rock-Paper-Scissors-Lizard-Spock, your robot reflexes let you see your opponent's throw before they make it. You just need to choose a throw that beats theirs, in as few bytes as possible ...
38
votes
19answers
4k views

Is it a circumfix?

Introduction We all know prefixes and suffixes. But there are other types of affixes that exist too. Such as circumfixes, a type of affix that has two parts, one of which is a prefix and another of ...
8
votes
5answers
439 views

Time to settle this: Java vs C++ [duplicate]

Story In an unnamed company, some people use Java and some use C++. This was always a nuisance, and they kept on arguing which single language they should all be using. To settle the dispute, the ...
7
votes
5answers
391 views

Regular ASCII Polygons

There are 4 regular polygons that we can construct using ASCII art: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....
16
votes
37answers
3k views

Do you make me up?

Introduction Every string has an "alphabet", composed of the characters that make it up. For example, the alphabet of \$abcaabbcc\$ is \${a, b,c}\$. There are two operations you can do with alphabets:...
11
votes
8answers
435 views

Restricted-source polyglot string

Your goal is to write a program that prints the string abc in two languages. However, while the full code will print abc in one ...
15
votes
8answers
737 views

Spelling on a Grid

(based on this deleted question) Take the English alphabet a b c d e f g h i j k l m n o p q r s t u v w x y z (spaces added for clarity), and split it into chunks ...
21
votes
37answers
4k views

ASCII Expansion

Introduction Every number can be represented as ASCII. For example, \$0\$ comes in ASCII is \$48\$, \$1\$ is \$49\$, and so on. Using this method of translating numbers to other numbers, it is ...
-1
votes
0answers
75 views

Reverse All Characters in a Word [duplicate]

Here's a quickie, just flip the position of all letter like this: "Hello World!" ==> "!dlroW elloH"
-2
votes
8answers
239 views

or iinterpreter [duplicate]

or is a dubious esoteric programming language. The author is unknown but it is known that fungot (a chatbot) is currently learning or but it remains unknown how it does it and where it receives the ...
0
votes
2answers
295 views

KILL ALIENS NOW! [closed]

The world has been invaded by aliens. They are everywhere killing people and taking over the world. You are hiding with your friend. They have one weakness - the high pitched sounds. You can't go ...
15
votes
8answers
892 views

Surjection from one string to two strings

This is the inverse of negative seven's question. Write a program or function which, given any single, possibly-empty string of printable ASCII (codes \$[32,126]\$) outputs or returns two strings of ...
1
vote
15answers
373 views

type in a random mess of capital letters [duplicate]

SOMe PEOPle lIkE tO TYpE iN A LoGiCAL MAnNER, WITh CapITals aT tHe bEGiNnIng Of ThE SENtENCE and smaLl LETTErS EVeRYWHErE eLsE. NOT Us. NOt Us. Your joB iS to tAkE A SenTEncE Of A LL SMAlL LeTTeRS, ...
29
votes
12answers
5k views

Mutate my DNA sequence

When translating DNA into proteins, the ribosomes read the sequence of DNA nucleotides 3 by 3. Each set of 3 nucleotides is called a codon, and each codon encodes for an amino acid, with some ...
10
votes
7answers
433 views

A Change in Perspective

In this challenge you will write a piece of text which when viewed from two different angles will create two different programs. Your string as viewed from above must take a string containing only ...
10
votes
8answers
2k views

Russian Caesar cipher

The objective Given a Russian text, encrypt it with Caesar cipher with key 16. The basic Cyrillic alphabets The basic Cyrillic alphabets are: (U+0410 – U+042F) ...
13
votes
5answers
500 views

Typing, but to the left [closed]

Background You've been given a task to take notes for a meeting. You start typing on your Google Doc, but you don't have enough time during the meeting to look at your keyboard while you type. ...
20
votes
20answers
5k views

Code Golf Measurer © 2019

Code Golf Measurer © 2019 Hexdumps used with xxd look something like this: ...
9
votes
3answers
367 views

North Korean dictionary order

The objective Given a string of Hangul syllables, sort the characters in North Korean dictionary order. Introduction to Hangul syllables Hangul(한글) is the Korean writing system invented by Sejong ...
15
votes
5answers
2k views

What's the current zodiac?

Display the emoji of the eastern zodiac of given time, according to given country. The eastern zodiac is a classification scheme that assigns an animal and its reputed attributes to each year in a ...
20
votes
7answers
2k views

Diamondize Some Text

Given an input string of length 2 or longer consisting solely of alphabetical characters [A-Z] or ...
6
votes
7answers
475 views

C4_4 Reflection!

In this challenge, your task is to input a rectangle ASCII pattern (You may assume only printable characters need to be handled, and you may assume a trailing newline or not), C4_4 symmetrify, and ...
24
votes
23answers
4k views

Fill a bowl with alphabet soup

We seem to never get tired of alphabet-related challenges... The recipe Given a string of letters S, and two positive integers ...
16
votes
6answers
956 views

From Plate to State

This is essentially the inverse of Generate a US License Plate Challenge: Given a string that matches one of the below license plate formats, output all possible states that match that formatting. In ...
2
votes
0answers
140 views

Test the endianness

Given a UTF-16 string, test its endianness. Rules: As long as the input is in UTF-16 without BOM, its type doesn't matter. In C++ on Windows, it can be ...
6
votes
2answers
312 views

BLUEREDGOLDEGGSFEATHERSFEATHERS

There's a little-known secret in Banjo-Kazooie that you can interleave the three Cheato codes on the Treasure Trove Cove Sandcastle floor and it will still recognize all of them. So you could, for ...
11
votes
9answers
2k views

Postman Delivery

I just got a job as a postman and I need your help to keep it. I have to order a lot of mails before I go out to deliver them. Streets are numbered strictly sequentially, starting with 1 at the start ...
2
votes
1answer
88 views

Decode a UTF-8 string to character byte counts [duplicate]

Given a UTF-8 string, give a string that represents byte counts of each characters. Rules: As long as the input string is encoded in UTF-8 (without BOM), its type doesn't matter. In C++, it can be <...
13
votes
28answers
2k views

Injection from two strings to one string

Challenge Write a program that applies an injective function which takes an ordered pair of strings as input and one string as output. In other words, each input must map to a unique output. ...
4
votes
7answers
158 views

Replace by most recent nonzero [duplicate]

Given a non-empty list of decimal digits (0, 1, ..., 9), replace each zero by the most ...
7
votes
10answers
552 views

Split string using rules

Introduction Some time ago, I need to write function which split string in some specific way. At the first look, task looks trivial, but it was not so easy - especially when I want to decrease code ...
40
votes
18answers
10k views

Duck, duck, gone!

Here is the (quite scary) Five little ducks song(it is not long): ...
42
votes
30answers
8k views

French license plates

Sandbox French License Plates French license plates come in a sequential order, following a specific pattern of numbers and letters : AB-012-CD Challenge Write ...