-1

So, I wanted to know the meaning of ".$" and why does this command delete the last character of a String.

I got what I wanted but i just want an explanation for it.

1 Answers1

-1

Because is a regular expression and $ mean "last"

MiguelAngel_LV
  • 1,200
  • 5
  • 16
  • "*$ mean "last"*" no, `$` means *end of the input or line* (depending on multiline flag). If it would mean *last* then replacing `a$` with `X` could change `"aab"` into `"aXb"` (which doesn't happen). – Pshemo Jan 20 '23 at 17:55