mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
refactor: Adding validation to StringUtils.Repeat
This commit is contained in:
parent
381355beb9
commit
8a260e0475
1 changed files with 6 additions and 1 deletions
|
|
@ -423,7 +423,12 @@ namespace ICD.Common.Utils
|
||||||
[PublicAPI]
|
[PublicAPI]
|
||||||
public static string Repeat(string input, int count)
|
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>
|
/// <summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue