PostSharp6.0/API Reference/Post­Sharp.​Patterns.​Formatters Namespace/Unsafe­String­Builder Class/Unsafe­String­Builder Methods/Unsafe­String­Builder.​Set­Null­Termination Method

UnsafeStringBuilder.SetNullTermination Method

Appends a null character at the end of the current string, without affecting the string length. In case of overflow, if ThrowOnOverflow is false, the last character of the string is removed and the string lenght is decreased by 1.

Namespace:  PostSharp.Patterns.Formatters
Assembly:  PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 6.0.35.0 (6.0.35.0)
Syntax
C#
public bool SetNullTermination()

Return Value

Type: Boolean
true if the string was null-terminated without affecting its length, or false if the last character of the string was replaced by the null character and the string length was decreased by 1.
See Also