X Tutup
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1910,22 +1910,24 @@ private char GetCharacterUnderCursor(Coordinates cursorPosition)
#endif

/// <summary>
/// Strip nulls from a string...
/// Strip nulls from a string.
/// </summary>
/// <param name="input">The string to process.</param>
/// <returns>The string with any \0 characters removed...</returns>
/// <returns>The string with any '\0' characters removed.</returns>
private static string RemoveNulls(string input)
{
if (input.Contains('\0'))
if (!input.Contains('\0'))
{
return input;
}

StringBuilder sb = new StringBuilder();
StringBuilder sb = new StringBuilder(input.Length);
foreach (char c in input)
{
if (c != '\0')
{
sb.Append(c);
}
}

return sb.ToString();
Expand Down
X Tutup