.NET API
TextTrimming
Namespace Tracon · Assembly
Tracon.Core.dllTrims text to a UTF-8 byte limit.
public static class TextTrimmingInheritance
Section titled “Inheritance”Inherited Members
Section titled “Inherited Members”object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”Pure and stateless. Used both to bound a tool’s result
(TruncatingAIFunction) and an MCP resource’s content
(Tracon.Mcp).
Methods
Section titled “Methods”Trim(string, int)
Section titled “ Trim(string, int)”Trims text to a UTF-8 byte limit. Never cuts in the middle of a multi-byte character; in that case, the whole character is dropped.
public static (string Text, bool Truncated) Trim(string text, int maxBytes)Parameters
Section titled “Parameters”text string
The text to trim.
maxBytes int
The maximum byte limit.
Returns
Section titled “Returns”The trimmed text and whether trimming occurred.