code: static void appendReducedApostrophes(String s, int start, int limit,
                                                         StringBuilder sb) {
          int doubleApos=-1;
          for(;;) {
              int i=s.indexOf('\'', start);
              if(i<0 || i>=limit) {
                  sb.append(s, start, limit);
                  break;
              }
              if(i==doubleApos) {
                  // Double apostrophe at start-1 and start==i, append one.
                  sb.append('\'');
                  ++start;
                  doubleApos=-1;
              } else {
                  // Append text between apostrophes and skip this one.
                  sb.append(s, start, i);
                  doubleApos=start=i+1;
              }
          }
      }
docs: /* package