Skip to content

Instantly share code, notes, and snippets.

View rtpHarry's full-sized avatar
🎯
Focusing on learning something every day

Matthew Harris rtpHarry

🎯
Focusing on learning something every day
View GitHub Profile
@rtpHarry
rtpHarry / GetAlphaRouletteLinksHtmlMarkup.cs
Last active December 21, 2015 05:08
Code sample written for a StackOverflow question to show how to build alpha link roulette html by extracting and grouping the first letters of a list of jobs.
public class GetAlphaRouletteLinks
{
// Outputs markup like this:
// <a href="#rouletteA">A</a> | <a href="#rouletteB">B</a> | <a href="#rouletteC">C</a> | <a href="#rouletteD">D</a> | <a href="#rouletteE">E</a> | <a href="#rouletteF">F</a> | G | <a href="#rouletteH">H</a> | <a href="#rouletteI">I</a> | <a href="#rouletteJ">J</a> | K | <a href="#rouletteL">L</a> | <a href="#rouletteM">M</a> | <a href="#rouletteN">N</a> | <a href="#rouletteO">O</a> | <a href="#rouletteP">P</a> | <a href="#rouletteQ">Q</a> | <a href="#rouletteR">R</a> | <a href="#rouletteS">S</a> | <a href="#rouletteT">T</a> | <a href="#rouletteU">U</a> | V | <a href="#rouletteW">W</a> | X | Y | Z
// Notice how it skips the link for any letters that don't have jobs starting with that letter eg:
// <a href="#rouletteW">W</a> | X | Y | Z
public string GetAlphaRouletteLinksHtmlMarkup()
{
var JobList = new List<String>() {