code: static String removePrivateuseVariant(String privuseVal) {
          StringTokenIterator itr = new StringTokenIterator(privuseVal, LanguageTag.SEP);
  
          // Note: privateuse value "abc-lvariant" is unchanged
          // because no subtags after "lvariant".
  
          int prefixStart = -1;
          boolean sawPrivuseVar = false;
          while (!itr.isDone()) {
              if (prefixStart != -1) {
                  // Note: privateuse value "abc-lvariant" is unchanged
                  // because no subtags after "lvariant".
                  sawPrivuseVar = true;
                  break;
              }
              if (AsciiUtil.caseIgnoreMatch(itr.current(), LanguageTag.PRIVUSE_VARIANT_PREFIX)) {
                  prefixStart = itr.currentStart();
              }
              itr.next();
          }
          if (!sawPrivuseVar) {
              return privuseVal;
          }
  
          assert(prefixStart == 0 || prefixStart > 1);
          return (prefixStart == 0) ? null : privuseVal.substring(0, prefixStart -1);
      }
docs: /*
  Remove special private use subtag sequence identified by "lvariant"
  and return the rest. Only used by LocaleExtensions