Spec-Zone.ru › Dart 1

dart:core

Метод replaceFirst абстрактного типа

String replaceFirst(Pattern from, String to, [ int startIndex = 0 ])

Возвращает новую строку, в которой первое вхождение from в этой строке заменено на to, начиная с startIndex:

'0.0001'.replaceFirst(new RegExp(r'0'), ''); // '.0001'
'0.0001'.replaceFirst(new RegExp(r'0'), '7', 1); // '0.7001'

Исходный код

String replaceFirst(Pattern from, String to, [int startIndex = 0]);

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-core/String/replaceFirst.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API