EncodingGetByteCount Method (String) |
When overridden in a derived class, calculates the number of bytes produced by encoding the characters in the specified string.
Namespace: System.TextAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public virtual int GetByteCount(
string s
)
Parameters
- s
- Type: SystemString
The string containing the set of characters to encode.
Return Value
Type:
Int32The number of bytes produced by encoding the specified characters.
Exceptions Exception | Condition |
---|
ArgumentNullException | s is null. |
EncoderFallbackException | A fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and-EncoderFallback is set to EncoderExceptionFallback. |
See Also