To get the last 3 characters, do `echo ${foo: -3}`. Are you trying to get the file extension though? What if the extension is not 3 characters e.g. `foo.jpeg`? You then want to do `${foo##*.}`
It is not helpful to people who are trying to solve a different problem correctly, who would like an answer to the exact question that the original poster asked, nor is it useful to people who are trying to solve the same problem but in a different, also wrong way - as they will likely never see the post.
Neal Gaiman did a compendium of Norse Mythology, and in it he claims that Thor says, "When something weird happens I always assume Loki is involved. It saves time." That's the line that stuck with me the most out of that entire book.
The people who fall into this category will tune you out while you say over and over "this is going to hurt us next year" and come in with a Pikachu face a year from now when they find out that it's been a year and the chickens have come home to roost.
People, as it turns out, are much more accepting of a team delivering consistently 10% slower than expected versus a team that delivers to expectations one year and suddenly drops by 50% a year later. They can't understand that. They can't predict it. It just looks to them like you've stopped doing what you are paid to do, rather than the truth which is you stopped doing what you were paid to do 2 years ago and you didn't jump ship before the consequences showed up.
Those who are experienced enough to understand the X-Y problem will recognise and acknowledge this. Those who aren't will often find reason to take offense.
<shrug>