Click or drag to resize
Local Multiplayer for iOS/tvOS/macOS
AppleLocalMultiplayerUtilityTruncateStringToEncodingBytes Method
Truncates the strings to a number of bytes in a given encoding.

Namespace:  LostPolygon.Apple.LocalMultiplayer
Syntax
C#
public static string TruncateStringToEncodingBytes(
	string str,
	int maxByteCount,
	Encoding encoding = null
)

Parameters

str
Type: SystemString
String to truncate
maxByteCount
Type: SystemInt32
Maximum number of bytes the string can take in encoding
encoding (Optional)
Type: System.TextEncoding
Target encoding. UTF8 is used if null

Return Value

Type: String
See Also