Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
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
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
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
Results tagged with Search options user 19547

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

4
votes
C# 125 98 Bytes using System.Linq;s=>s.GroupBy(c=>c).Where(g=>g.Key!=' ').Select(g=>new string(g.Key,g.Count()))); Explanation //Using anonymous function to remove the need for a full signature … //And also allow the implicit return of an IEnumerable s => //Create the groupings s.GroupBy(c => c) //Remove spaces .Where(g=> g.Key!=' ') //Generate a new string using the …
answered Aug 24 '16 by Phaeze
2
votes
to @Milk for suggesting a neat method and saving 6 more bytes An anonymous function that takes a string and counts the odd letters then returns true if there is an odd number of them or false if … there is not. This new solution splits the string on any of the characters in the given char array. The mechanics of this flip the meaning of the %2 result; 0 is now odd and 1 even hence the 1>. Try it online here! …
answered Sep 20 '16 by Phaeze
5
votes
mandatory using string.Join(".", //Recreate the version string with the new values v.Split('.') //Get individual pieces .Select(int.Parse …
answered Dec 8 '16 by Phaeze
3
votes
row s.Aggregate("", // Empty string is required to cooerce the output type from char (c, y)=> // c is the generated string so far, y is the next … to collapse to -1, 0, or 1 // Finally add 1 to line it up with the indexes of the constant string
answered May 27 '16 by Phaeze