Comments on: https://tariquesani.net/blog/2003/01/16/225/ Pediatrician and a Forensic Expert. A passionate PHP geek. Currently CTO, SANIsoft. Also a photographer, bird watcher, nature lover and a FOSS enthusiast. Mon, 19 Sep 2016 13:33:04 +0000 hourly 1 https://wordpress.org/?v=4.5.3 By: tariquesani https://tariquesani.net/blog/2003/01/16/225/#comment-323 Sun, 19 Jan 2003 12:50:26 +0000 https://tarique.sanisoft.com/lj/?p=225#comment-323 Yeah! that is how I would expect a language to behave in terms of convenience, but Java just insists that “” is not a character rather than going ahead and doing the necessary conversion internally.

]]>
By: jace https://tariquesani.net/blog/2003/01/16/225/#comment-322 Sun, 19 Jan 2003 07:30:32 +0000 https://tarique.sanisoft.com/lj/?p=225#comment-322 Python: "0-553-38096-6".replace("-", "")

]]>
By: tariquesani https://tariquesani.net/blog/2003/01/16/225/#comment-321 Thu, 16 Jan 2003 15:18:19 +0000 https://tarique.sanisoft.com/lj/?p=225#comment-321 Yes! of course there is a replace command in Java but it takes 2 *characters* as parameters

]]>
By: itsjoy https://tariquesani.net/blog/2003/01/16/225/#comment-320 Thu, 16 Jan 2003 12:56:19 +0000 https://tarique.sanisoft.com/lj/?p=225#comment-320 morning..

i wasnt suggesting trim() was a solution to your problem. Just that he would make you sing its glories as your last act even if it didnt work for you the way you wanted it to.

Think theres a replace method in java too, btw.

]]>
By: tariquesani https://tariquesani.net/blog/2003/01/16/225/#comment-319 Thu, 16 Jan 2003 12:47:57 +0000 https://tarique.sanisoft.com/lj/?p=225#comment-319 He He He!! may be you deserve your prof 😉

I have been relearning Java since past 15 days but I know trim() will only remove whitespaces from begining and end of the string. I want to remove all whitespaces from *between* a string

In PHP I can do a replace with a null value and get what I want

]]>
By: itsjoy https://tariquesani.net/blog/2003/01/16/225/#comment-318 Thu, 16 Jan 2003 03:25:04 +0000 https://tarique.sanisoft.com/lj/?p=225#comment-318 lol, my java prof would have handed you your head on a platter for a statement like that if we all lived in his dream world! And he would’ve made you read about trim() as your last act :))

naah, hes not that bad

just curious though, which languages have a function to do what you want it to?

]]>