×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Karthick Bala
Added: Jul 25, 2014 10:22 AM
Views: 8
Tags: no tags
  1.     public static String optStringValue(JSONObject jsonObj, String key) {
  2.         String stringVal = "";
  3.         String tempStr = jsonObj.optString(key);
  4.         if(tempStr != null && tempStr.length() > 0) {
  5.             stringVal = tempStr;
  6.         }
  7.         return stringVal;
  8.     }