HexLibraryHexLibrary
</> HexCodeSign inSign up
PythonJavaScriptTypeScriptCC++JavaPHPGoRustRubyBashSQLLuaPerlCOBOLPascalDelphiFortranDartSwiftC#JuliaGroovyRElixirHaskellKotlinScalaClassic ASPClipperMS-DOS
LESSONS
Introduction to DartVariablesData TypesOperatorsStringsListsConditions (if / else)Loops (for / while)Functions
REFERENCE
📖 Overview
🖥️ Output
📦 Variables & Types
🔢 Numbers & Math
✍️ String
.length / .toUpperCase().substring() / .contains().split() / .replaceAll()
📚 List & Map
🔀 Condition & Loop
🧩 Function
Dart›REFERENCE›String
✍️

String

Length, character, splitting, and searching methods.

CommandDescription
.length / .toUpperCase()Length and case conversion.
.substring() / .contains()Substring extraction and searching.
.split() / .replaceAll()Splitting and replacing.

.length / .toUpperCase()

Try it yourself →

Length and case conversion.

Syntax

text.length  //  text.toUpperCase()

Description

length gives the number of characters. toUpperCase converts to uppercase, toLowerCase converts to lowercase (returns new text, original remains unchanged).

Example

void main() {
  var s = "HexLibrary";
  print(s.length);
  print(s.toUpperCase());
  print(s.toLowerCase());
}

Expected output

10
HEXLIBRARY
hexlibrary

When to use?

Input validation, case-insensitive comparison.

.substring() / .contains()

Try it yourself →

Substring extraction and searching.

Syntax

text.substring(start, [end])  //  text.contains(part)

Description

substring extracts a piece using start (inclusive) and end (exclusive) indices. contains tells whether a piece exists (true/false).

Example

void main() {
  var s = "HexLibrary";
  print(s.substring(0, 3));
  print(s.contains("Lib"));
}

Expected output

Hex
true

When to use?

Trimming text, search boxes.

.split() / .replaceAll()

Try it yourself →

Splitting and replacing.

Syntax

text.split(separator)  //  text.replaceAll(old, new)

Description

split divides the text at the given separator and returns a List. replaceAll replaces all matches with a new one (returns new text).

Example

void main() {
  var csv = "a,b,c";
  print(csv.split(","));
  print("2024-01".replaceAll("-", "/"));
}

Expected output

[a, b, c]
2024/01

When to use?

CSV parsing, text cleaning.

HexLibraryHexLibrary

Learn programming more clearly. Every command is explained line by line with colors, reinforced with runnable exercises, test your code instantly — all in one place, free.

Learn

  • Home
  • Languages & Lessons
  • HexCode

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Use

Other Projects

  • HexToolz
  • Free Service Manuals
© 2026 HexLibrary · The clearest way to learn code