Share via


GetBytes Method (String)

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Encodes the characters in a specified String object into a sequence of bytes.

Namespace:  System.Text
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Overrides Function GetBytes ( _
    s As String _
) As Byte()
public override byte[] GetBytes(
    string s
)
public:
virtual array<unsigned char>^ GetBytes(
    String^ s
) override
abstract GetBytes : 
        s:string -> byte[] 
override GetBytes : 
        s:string -> byte[] 
public override function GetBytes(
    s : String
) : byte[]

Parameters

Return Value

Type: array<System. . :: . .Byte> [] () [] []
A byte array that contains the encoded characters in the string specified by the s parameter.

.NET Framework Security

See Also

Reference

UTF8Encoding Class

GetBytes Overload

System.Text Namespace