mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-02 22:35:00 +00:00
refactor: Adding validation to StringUtils.Repeat
This commit is contained in:
@@ -423,7 +423,12 @@ namespace ICD.Common.Utils
|
||||
[PublicAPI]
|
||||
public static string Repeat(string input, int count)
|
||||
{
|
||||
return count == 0 ? string.Empty : new StringBuilder().Insert(0, input, count).ToString();
|
||||
if (count < 0)
|
||||
throw new ArgumentOutOfRangeException("count");
|
||||
|
||||
return input == null || count == 0
|
||||
? string.Empty
|
||||
: new StringBuilder().Insert(0, input, count).ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user