take static method
Returns the first limit characters of value.
Implementation
static String take(String value, int limit) {
if (limit < 0) {
final start = value.length + limit;
return start < 0 ? value : value.substring(start);
}
return value.length <= limit ? value : value.substring(0, limit);
}