DbgShell/HostUtilities.cs
/// <summary>
/// Gets the first <paramref name="maxLines"/> lines of <paramref name="source"/>.
/// </summary>
/// <param name="source">string we want to limit the number of lines</param>
/// <param name="maxLines"> maximum number of lines to be returned</param>
/// <returns>The first lines of <paramref name="source"/>.</returns>
Gets the first  lines of .
Gets the first lines of .
internal static string GetMaxLines(string source, int maxLines)
        {
            if (String.IsNullOrEmpty(source))
            {
                return String.Empty;
            }
            StringBuilder returnValue = new StringBuilder();
            for (int i = 0, lineCount = 1; i < source.Length; i++)
            {
                char c = source[i];
                if (c == '\n')
                {
                    lineCount++;
                }
                returnValue.Append(c);
                if (lineCount == maxLines)
                {
                    returnValue.Append("...");
                    break;
                }
            }
            return returnValue.ToString();
        }
internal static string GetMaxLines ( string source , int maxLines ) { if ( String . IsNullOrEmpty ( source ) ) { return String . Empty ; } StringBuilder returnValue = new StringBuilder ( ) ; for ( int i = 0 , lineCount = 1 ; i < source . Length ; i ++ ) { char c = source [ i ] ; if ( c == ' \n ' ) { lineCount ++ ; } returnValue . Append ( c ) ; if ( lineCount == maxLines ) { returnValue . Append ( " " ) ; break ; } } return returnValue . ToString ( ) ; }
Gets the first  lines of .
Gets the first lines of .
The first lines of .
The first lines of .
source
string
string we want to limit the number of lines
string we want to limit the number of lines
maxLines
int
maximum number of lines to be returned
maximum number of lines to be returned