I forgot to post this one in my blog when I found out lyrics can now be seen in iTouch’s firmware of 1.1.3. I’ve been wondering myself why Apple took a very long time to have this feature enabled. Actually even with the firmware 1.1.3 they never announced it. With this, we can finally sing a long while we listen to our favorite music.
Adding lyrics is an old feature of iTunes though. Just copy and paste it in the Lyrics tab of the music in iTunes when you select its properties. Now, we can finally make use of the lyrics. Keep in mind though, that this feature is not found in nano video or below. only with iPhone and iTouch. Searching for lyrics and pasting them one by one is a hassle though, but there’s a neat widget in Mac that actually fetches the lyrics for you when you play the music in your iTunes. The widget is called TunesTEXT. Pretty nifty, saves you all the trouble of finding the lyrics.
If you want all your mp3s to have lyrics, just leave your iTunes running. Once the next song plays, TunesTEXT automatically searches for the song and appends it into the mp3 file. Now, I can really say owning an iTouch is very much worth it. This was the number 1 feature that I wanted ever since iPod was created and it’s finally here.
Java’s replace method is not ideal for noobs but only for people who know about regex. I am not that quite familiar with regex and if you wish to use that replace method under the String class in Java, you’d have to familiarize yourself with it in order to use it. The String class though, has lots of other useful methods that can be used to simulate how a search and replace function works. Here is a workaround method for people who only want a simple search and replace with the search and target both String. No regex knowledge needed.
The method replaceString returnsaStringandtakes in3parameters.First would be the original stringwhere you want your search andreplace totake place into.Second isbe the stringtosearch forandthird isthe replace string.
varstr='this is a string';
The replace function contains two options. ‘i’ means the search would be case insensitive and ‘g’ means global, meaning it will search all instances of the search string within the str variable. If you do not include ‘g’ as its option, then only the first instance of the search string will be replaced.
I find this stupid. It would have been easier if it still returned an int value like the usual -1 to indicate it didn’t find any substring inside the string.
To do an if statement using strpos() of PHP just like this Java code: