FIND YOUR NEXT FEW LINES

Results for “convert”

Small, practical examples. Search by task or narrow things down below.

72 snippets foundClear filters
JavaEncoding & structured values

Encode and decode Base64 bytes

Java: Convert through UTF-8 explicitly before and after Base64 encoding.

Java✓ Tested
PowerShellStructured formats & encodings

Encode and decode UTF-8 text with Base64

PowerShell: Convert the string to bytes explicitly before Base64 encoding.

PowerShell✓ Tested
PowerShellStructured formats & encodings

Escape plain text before placing it in HTML

PowerShell: HtmlEncode converts HTML delimiters to entities in ordinary text contexts.

PowerShell✓ Tested
C#Asynchronous work & URI handling

Escape text for an HTML context

C#: HtmlEncode converts markup delimiters in plain text before rendering it as HTML content.

C#✓ Tested
PythonStrings & dates

Extract numbers from text

Find all runs of ASCII digits in a string and convert the matches to integers.

regex✓ Tested
CBinary formats & structured parsing

Format a known timestamp in UTC

C: gmtime converts to UTC calendar fields and strftime formats them.

C✓ Tested
PowerShellStructured formats & encodings

Handle a malformed JSON document

PowerShell: ConvertFrom-Json reports a terminating conversion error under the selected error preference.

PowerShell✓ Tested
JavaStream transformations

Join transformed stream values

Java: Use Collectors.joining after converting elements to strings.

Java✓ Tested
JavaScriptStrings

Pad a numeric label

Convert a number to text and pad it to a fixed width.

JavaScript✓ Tested
PowerShellDates & numeric validation

Parse a hexadecimal integer

PowerShell: Convert.ToInt32 accepts an explicit base for a validated hexadecimal string.

PowerShell✓ Tested
PythonJSON & CSV

Parse a JSON string

Convert a JSON string into a Python dictionary and read values by key.

json✓ Tested
PythonFunctions & error handling

Parse a typed command-line option

Python: Use argparse to validate and convert an integer option.

Python✓ Tested