Used for in-line, fixed-length character arrays that appear within a structure. The character type used with UnmanagedType.ByValTStr is determined by the System.Runtime.InteropServices.CharSet argument of the System.Runtime.InteropServices.StructLayoutAttribute attribute applied to the containing structure. Always use the MarshalAsAttribute.SizeConst field to indicate the size of the array.
.NET Framework UnmanagedType.ByValTStr types behave like C-style, fixed-size strings inside a structure (for example, char s). The behavior in managed code differs from the Microsoft Visual Basic 6.0 behavior, which is not null terminated (for example, MyString As String * 5).