Fixed image sequence output

This commit is contained in:
N00MKRAD
2020-12-02 15:34:59 +01:00
parent 2c061317d3
commit bd408f3423
7 changed files with 37 additions and 12 deletions

View File

@@ -97,9 +97,12 @@ namespace Flowframes
return Regex.Split(str, "\r\n|\r|\n");
}
public static string Trunc(this string value, int maxChars)
public static string Trunc(this string value, int maxChars, bool addEllipsis = true)
{
return value.Length <= maxChars ? value : value.Substring(0, maxChars) + "…";
string str = value.Length <= maxChars ? value : value.Substring(0, maxChars);
if(addEllipsis)
str += "…";
return str;
}
public static string StripBadChars(this string str)
@@ -142,5 +145,15 @@ namespace Flowframes
}
return newString.ToString();
}
public static string ReplaceLast (this string str, string stringToReplace, string replaceWith)
{
int place = str.LastIndexOf(stringToReplace);
if (place == -1)
return str;
return str.Remove(place, stringToReplace.Length).Insert(place, replaceWith);
}
}
}