#34 StringUtils.substr

Ditutup
dibuka 4 tahun lalu oleh ranides · 0 komentar

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 referenced this issue from a commit 4 tahun lalu
Masuk untuk bergabung dalam percakapan ini.
Tidak ada tonggak
Tidak ada penerima
1 Peserta
Memuat...
Batal
Simpan
Belum ada konten.