Text.ToCString

From Xojo Documentation

Method

Text.ToCString(encoding As Xojo.Core.TextEncoding) As CString

Supported for all project types and targets.

Creates a CString from a Text with a specific encoding. The CString is immutable and is its own entity with the lifetime not tied to the source text value. This is provided to make dealing with declares easier.

Notes

In general, CString is for use with Declare commands and MemoryBlocks.

Exceptions

Sample Code

Convert text to CString:

Dim t As Text = "Hello, World!"
Dim cs As CString = t.ToCString(Xojo.Core.TextEncoding.UTF8)