Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
A competition to solve a particular problem through the usage and manipulation of strings.
5
votes
Undress a string
C# (.NET Core), 192 183 182 181 179 178 bytes
-3 bytes thanks to Kevin Cruijssen
n=>{var o=n+"\n";for(var e=1;n.Trim()!=n;){if(1>(e^=1))if(n[0]<33)n=n.Remove(0,1);else continue;else if(n.TrimEnd() …
0
votes
"Hello, name!";
ReRegex, 17 bytes
Trivial and probably as short as it can get.
Hello, (?#input)!
Try it online!
2
votes
Find the needle in the haystack
C# (Visual C# Interactive Compiler), 109 108 107 bytes
First() => Last() for -1 byte
currying for -1 byte thanks to Embodiment of Ignorance
a=>w=>{var d=a.Where(b=>b!=a[0]).Select(b=>a.IndexOf(b) …
1
vote
As programmers say: Strive to be lazy
s=>(r=s.Split(' ')).Select((a,i)=>(string.Join(" ",r.Take(i))+" \""+a+"\" "+string.Join(" ",r.Skip(i+1))).Trim());string[]r
Try it online! …
0
votes
Point out a string character
C# (Visual C# Interactive Compiler), 100 98 bytes
a=>b=>a+(b>(i=(int)b)?"/\\":"^").PadLeft((v=b>i?2:1)+i)+'\n'+a.Substring(i,v).PadLeft(v+i);int i,v
Try it online!
2
votes
Make me speak L33T
C# (Visual C# Interactive Compiler), 53 bytes
Inputs a string, outputs an array of char codes.
s=>s.Select(c=>"beisBEIS".Contains(c)?48+17/(c%16):c)
Try it online! …
2
votes
Cook me a character meal
C# (Visual C# Interactive Compiler), 54 63 60 bytes
s=>t=>t.Min(x=>x>32?s?.Count(c=>c==x)/t.Count(c=>c==x):null)
Min can calculate the minimum selectively if int? objects are used. To obtain such …
2
votes
How happy is this emoticon?
C# (Visual C# Interactive Compiler), 17 14 bytes
Turns out Ranges finally started to actually exist and work! Thanks to an anonymous user for pointing this out (by proposing an edit, but anonymous us …
0
votes
Mask values in a .env file for a screencast
Overly generic explanation:
:%norm on every line do these normal mode commands
$ go to the end of string
vT= select until but not including the previous =
r• replace …
4
votes
Bl lu ur rr ry yv vi is si io on - Blur the text
C# (Visual C# Interactive Compiler), 74 bytes
This ended up very similar to the Python answer. I was trying something noticeably more interesting with Aggregate, but the terrible no trailing whitespa …
4
votes
Special String reformatting
Wolfram Language (Mathematica), 34 bytes
This is the dreaded obvious chain-the-built-ins. Print can accept multiple arguments and will print them without any separators.
Print@@Flatten@Tally@Charact …
4
votes
Compute all close strings quickly
;
}
string insert(int i, char c) const
{
string copy;
copy.len = len + 1;
for(int j = 0; j < i; j++)
copy[j] = data[j];
for(int j = i; j < len; j … -1; j++)
copy[j] = data[j+1];
return copy;
}
string erase(int i) const
{
string copy;
copy.len = len - 1;
for(int j = 0; j < i; j++) …
5
votes
There are known knowns
C# (.NET Core), 54 bytes
v=>@"z zs
z unzs
unz zs
unz unzs".Replace("z","known")
Try it online!
7
votes
Code Golf Measurer © 2019
Retina, 7 bytes
This counts the total number of single-line strings of length 52. It might be possible to do something similar to %52,`., but I failed to find a way to fix that.
w`.{52}
Try it onl …
2
votes
Making Sandwiches
Retina, 12 bytes
(.*?)\1*$
$1
Try it online!