In computer science, the Boyer – Moore string-search algorithm is an efficient string-searching algorithm that is the standard benchmark for practical string-search literature. Moore algorithm uses information gathered during the preprocess step to skip sections of the text, resulting in a lower constant factor than many other string search algorithms.

This was first proved by Knuth, Morris, and Pratt in 1977, followed by Guibas and Odlyzko in 1980 with an upper bound of 5n comparisons in the worst case. Richard Cole give a proof with an upper bound of 3n comparisons in the worst case in 1991.When the shape makes happen in the text, working time of the original algorithm is

```
using System;
namespace Algorithms.Strings
{
/// <summary>
/// Implements simple algorithms on strings.
/// </summary>
public static class GeneralStringAlgorithms
{
/// <summary>
/// Finds character that creates longest consecutive substring with single character.
/// </summary>
/// <param name="input">String to find in.</param>
/// <returns>Tuple containing char and number of times it appeared in a row.</returns>
public static Tuple<char, int> FindLongestConsecutiveCharacters(string input)
{
var maxChar = input[0];
var max = 1;
var current = 1;
for (var i = 1; i < input.Length; i++)
{
if (input[i] == input[i - 1])
{
current++;
if (current > max)
{
max = current;
maxChar = input[i];
}
}
else
{
current = 1;
}
}
return new Tuple<char, int>(maxChar, max);
}
}
}
```