chop

Javascript chop/slice/trim off last character in string

I have a string 12345.00 would like it to return 12345.0 I have looked at trim but looks only to trim whitespace and slice which I don't see how this would work. Any suggs? ...

MySQL/SQL retrieve first 40 characters of a text field?

How can I retrieve a text field from mysql db table, but not the entire text, just the few 40 or so characters. Can this be done in sql or do I need to do it using php? basically what I am trying to do is show the first x characters and then let the user click on that to view the full content. ...

perl - get filesize with -s

I am trying to find filesize using -s operator. I looks like this: my $filesz = -s $filename I tried lots of various way but it can not get this size. However, If I give static content instead of filename, it works fine For exa: $filesz = -s "/tmp/abc.txt" This works fine. I tried adding " in filename, it didn't work. I removed \n fr...