StringExtensionsSizeAs(String, Encoding) Method

Calculates the amount of bytes occupied by the input string when being encoded as the target encoding

Definition

Namespace: PCBI_CadanceFab_Import
Assembly: PCBI_CadanceFab_Import (in PCBI_CadanceFab_Import.dll) Version: 16.0.0.0 (16.0.0.0)
C#
public static int SizeAs(
	this string input,
	Encoding targetEncoding
)

Parameters

input  String
The input string to check
targetEncoding  Encoding
The desired encoding to check for

Return Value

Int32
The total size of the input string in bytes

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentNullExceptioninput is null
ArgumentNullExceptiontargetEncoding is null

See Also