Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- name = "Paul James"
- age = 25
- result = My name is &name, I am &age years old.
- dimension x[5];
- x[0] = "box"
- x[1] = "area"
- text.&x[0]..text = "textbox" ---> textbox.text="textbox"
- text.&x[1]..text = "textarea" ---> textarea.text="textarea"
- JSONArray response =
- [{"name":"a","middlename":"aa","surname":"aaa"},{"name":"b","middlename":"bb","surname":"bbb"},{"name":"c","middlename":"cc","surname":"ccc"}]
- temp[] = [{name,middlename,surname}];
- String[] name = new String[response.firstobject.length];
- String[] middlename = new String[response.firstobject.length];
- String[] surname = new String[response.firstobject.length];
- @SuppressWarnings("null")
- public ArrayList<String> parseJson(JSONArray ja) throws JSONException{
- ArrayList<String> listItems = new ArrayList<String>();
- String[] temp = null;
- //Get all the fields first
- for (int i=0; i<=0; ++i){
- JSONObject jo = ja.getJSONObject(i);
- if(jo.length()>0){
- temp = new String[jo.names().length()];
- for(int x=0; x<jo.names().length(); ++x){
- temp[x] = jo.names().getString(x);
- }
- }
- }
- }
- STORE 'city' TO cVarCity
- REPLACE (cVarCity) WITH 'Paris'
- //--------- ejemplos :
- // STRTRAN("Hola * mundo","*", "//") ==> "Hola // mundo"
- public String STRTRAN(String cExpression, String cFindString, String cReplacement){
- return cExpression.replace(cFindString, cReplacement);
- }
- //------------------ ejemplos:
- // miToolkit.CHRTRAN("ABCDEF", "ACE", "XYZ"); // muestra XBYDZF. ok
- // miToolkit.CHRTRAN("ABCDEF", "ACE", "XYZQRST"); // muestra XBYDZF. ok
- // miToolkit.CHRTRAN("ABCD", "ABC", "YZ"); // muestra YZCD. No es como fox
- public String CHRTRAN(String cString, String cFindChars, String cNewChars){
- String cResult = cString;
- char[] aFindChars;
- char[] aNewChars;
- int nLength = cFindChars.length();
- aFindChars = cFindChars.toCharArray();
- aNewChars = cNewChars.toCharArray();
- if(cNewChars.length() < nLength){
- nLength = cNewChars.length() ;
- }
- for(int i=0; i < nLength; i++){
- cResult = cResult.replace( aFindChars[i], aNewChars[i] );
- }
- return cResult;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement