Skip to content

Commit

Permalink
imp - Truncation should not take out one letter
Browse files Browse the repository at this point in the history
---

String truncation should not take out one letter.

---

Type: imp
Breaking: False
Doc Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Dec 20, 2023
1 parent ea25947 commit 3eafa7f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Textify.Tests/General/TextToolsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public void TestReplaceAllRange()
[Description("Querying")]
public void TestTruncate()
{
string expected = "Nitrocid is awesome...";
string expected = "Nitrocid is awesome ...";
string Source = "Nitrocid is awesome and is great!";
int Target = 20;
Source = Source.Truncate(Target);
Expand Down
2 changes: 1 addition & 1 deletion Textify/General/TextTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public static string Truncate(this string target, int threshold)
// truncate the non-VT sequences.
int newLength = VtSequenceTools.FilterVTSequences(target).Length;
if (newLength > threshold)
return target.Substring(0, threshold - 1) + "...";
return target.Substring(0, threshold) + "...";
else
return target;
}
Expand Down

0 comments on commit 3eafa7f

Please sign in to comment.