#34 StringUtils.substr

Закрыто
4 лет назад открыта ranides · комментариев: 0
ranides прокомментировал 4 лет назад

Make method: substr(begin, length) which accepts negative indexes.

  • negative begin is counted from the end of string.
  • negative length is subtracted from length of string

Two arguments:

  • example: make string a bit shorter: .substr(0, -2)
  • example: extract last 3 characters: .substr(-3, 3)

Short version:

  • example: extract first 3 characters: .substr(3)
  • example: extract last 3 characters: .substr(-3)
Make method: `substr(begin, length)` which accepts negative indexes. - negative `begin` is counted from the end of string. - negative `length` is subtracted from length of string Two arguments: - example: make string a bit shorter: `.substr(0, -2)` - example: extract last 3 characters: `.substr(-3, 3)` Short version: - example: extract first 3 characters: `.substr(3)` - example: extract last 3 characters: `.substr(-3)`
ranides упомянул эту задачу в коммите 4 лет назад
Войдите, чтобы присоединиться к обсуждению.
Нет этапа
Нет ответственного
1 участников
Загрузка...
Отмена
Сохранить
Пока нет содержимого.