This commit is contained in:
@@ -115,6 +115,20 @@ namespace AyaNova.Util
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
//Used to ensure a unique name generated by appending -nnn is within length requirements by splitting and chopping part of text to keep name
|
||||
public static string UniqueNameBuilder(string oldName, long appendValue, int maxLength)
|
||||
{
|
||||
var appendString = "-" + appendValue.ToString();
|
||||
string ret = oldName + appendString;
|
||||
var diff = maxLength - ret.Length;
|
||||
if (diff < 0)
|
||||
{
|
||||
ret = oldName.Substring(0, Math.Abs(diff)) + appendString;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
//used to trim an enum type down to only it's most relevant (rightmost) portion
|
||||
public static string TrimTypeName(string str)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user