changeCommaValue static method

String changeCommaValue(
  1. String content,
  2. String key,
  3. String value, {
  4. String? separator,
  5. String? equalSymbol,
})

Comma Values

Implementation

static String changeCommaValue(String content, String key, String value, {String? separator, String? equalSymbol}) {
  List<int>? indexes = getCommaValueIndexes(content, key, separator: separator ?? ';', equalSymbol: equalSymbol ?? '=');
  String result = content;
  if (indexes != null) {
    result = content.replaceRange(indexes.first, indexes.last, value);
  }
  return result;
}