×

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:20 AM
Views: 1772
Tags: no tags
  1.     public static String getStringValue(JSONObject jsonObj, String key) {
  2.         String stringVal = null;
  3.         String tempStr = jsonObj.optString(key);
  4.         if(tempStr != null && tempStr.length() > 0) {
  5.             stringVal = tempStr;
  6.         }
  7.         return stringVal;
  8.     }