Hello Indian taxpayers good news for you .. Yes yeaterday Union Cabinet approved the long-awaited Direct Taxes Code (DTC) Bill under which the government has proposed to hike the income tax exemption limit to Rs. 2 lakh from the existing base of Rs. 1.6 lakh. Ofcourse this is proposal lets see what will happen. For more details got o THE HINDU
Friday, August 27, 2010
Java strings splitting issue
Yesterday I faced an interesting issue with java strings. I have a string values with .(dot) , ex. 127.4.3.2 ,,etc. My aim is to split the string by .(dot), As usual I used the following stmts to do it.
String myStr = "172.5.33.22";
String[] strs = myStr.split(".");
System.out.println("Length : " + strs.length);
But when I run the program the resulte strs length is 0. Then I modified myStr as '172,22,,5,6' and modified split str as ','. its resulting strs length as 4. I wondered why happening this, A quick googling I got solution and its worked. The sol is If you want to slpit the string by .(dot) you need to specify regExp as '\\.'.
The working code is
String myStr = "172.5.33.22";
String[] strs = myStr.split("\\.");
System.out.println("Length : " + strs.length);
String myStr = "172.5.33.22";
String[] strs = myStr.split(".");
System.out.println("Length : " + strs.length);
But when I run the program the resulte strs length is 0. Then I modified myStr as '172,22,,5,6' and modified split str as ','. its resulting strs length as 4. I wondered why happening this, A quick googling I got solution and its worked. The sol is If you want to slpit the string by .(dot) you need to specify regExp as '\\.'.
The working code is
String myStr = "172.5.33.22";
String[] strs = myStr.split("\\.");
System.out.println("Length : " + strs.length);
Now I got correct strs length.
Tuesday, August 24, 2010
Blogger Widgets: Official Sharing Buttons on Blogger
If you want to make your post to others share it, then check it out here. Blogger Widgets: Official Sharing Buttons on Blogger.
Labels:personal
Blog
Happy B'day Sree ...
May more happy returns of the day raa srekanth. As usual last night we celebrated his B'day @ necklaces road. Only myself, Bharat & Sai went to there from our batch and rest of us are sree's roommates. kalyan, ksn not joined with us due to health problems and venky was on vacation. We didn't spent much time there, just cut the cake and bumps. This time B'day boy had some more bumps than previous B'days.
This is last b'day for this year from our batch..... we need to wait 4 more months to celebrate next B'day, hope that time GOD will strengthen me as I can(Bcaz this is kalyan's turn. ;))... Actually Sree was ready to treat us today but we are unable to go due to some of us feeling sickness, probably tomorrow night we will met somewhere. Sreekanth once again I am wishing you a colorful and pleasent and great day.
This is last b'day for this year from our batch..... we need to wait 4 more months to celebrate next B'day, hope that time GOD will strengthen me as I can(Bcaz this is kalyan's turn. ;))... Actually Sree was ready to treat us today but we are unable to go due to some of us feeling sickness, probably tomorrow night we will met somewhere. Sreekanth once again I am wishing you a colorful and pleasent and great day.
Subscribe to:
Posts (Atom)