Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
find maximum consecutive repeating character
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { string str = "aaaaaabbcbbbbbcbbbb"; string longestRun = new string(str.Select((c, index) => str.Substring(index).TakeWhile(e => e == c)) .OrderByDescending(e => e.Count()) .First().ToArray()); Console.WriteLine(longestRun); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
random number generator using array
Math 9.3
factorial ncr
Random number maker block (better version)
Plt-D v.0.9 WOA
Testing 006
Interface
Is String a Palindrome
Making Anagrams
StopJoin.cs
Please log in to post a comment.