Sample code for 30+ languages & platforms
Dart

StringBuilder RemoveAfterFinal

Demonstrates the StringBuilder.RemoveAfterFinal method.

The GetBefore method was added in Chilkat v9.5.0.77

Chilkat Dart Downloads

Dart
import 'package:chilkat/chilkat.dart';

void main() {
  final sb = CkStringBuilder();
  sb.append('abc::def::ghi');

  // Replace the 1st occurrence of a substring with another string.
  var bFound = true;
  try {
    sb.replaceFirst('::', '-');
  } on ChilkatException {
    bFound = false;
  }

  print('bFound = $bFound');
  print('sb contains: ${sb.getAsString()}');

  // Output is:
  // bFound = True
  // sb contains: abc-def::ghi
}