Add a plain character to the prefix.
5687
function handlePlainCharacter(element, char) {
  const prefix = element[typedPrefixKey] || '';
  element[typedPrefixKey] = prefix + char;
  element.selectItemWithTextPrefix(element[typedPrefixKey]);
  setPrefixTimeout(element);
}
1096998
final void randomizePrefix() {
        byte[] cb = new byte[preLen];

        // Use SecureRandom for prefix only
        srand.nextBytes(cb);

        for (int i = 0; i < preLen; i++) {
            pre[i] = digits[(cb[i] & 0xFF) % base];
        }
    }
650774
def strip_prefix(string, prefix, regex=False):
    """"""
    if not isinstance(string, six.string_types) or not isinstance(prefix, six.string_types):
        msg = 'Arguments to strip_prefix must be string types. Are: {s}, {p}'\
              .format(s=type(string), p=type(prefix))
        raise TypeError(msg)

    if not regex:
        prefix = re.escape(prefix)
    if not prefix.startswith('^'):
        prefix = '^({s})'.format(s=prefix)
    return _strip(string, prefix)
873487
def __setPrefix(self):
        ''''''
        __prefix = ""
        if(self.__model_path_char is not None):
            __prefix = self.__model_path_char
            if(__prefix[-1] != "/"):
                __prefix = __prefix + "/"
        else:
            __prefix = os.path.dirname(os.path.realpath(__file__))+"/models/"
        return __prefix
1323585
function prefixifier(prefix, text, suffix) {
    text = stringify(text);
    if (!text) {
        return '';
    }
    suffix = suffix || '';
    return prefix + text.replace(/^\s+|\s+$/g, '') + suffix;
}
550547
function toRegex(prefix) {
  var key = appendPrefix(prefix, '(\\d+)');
  if (cache.hasOwnProperty(key)) {
    return cache[key];
  }
  var regex = new RegExp(createRegexString(key), 'g');
  cache[key] = regex;
  return regex;
}
546222
private void expandAffix(String pattern, String pluralCount, StringBuffer buffer) {
        buffer.setLength(0);
        for (int i = 0; i < pattern.length();) {
            char c = pattern.charAt(i++);
            if (c == QUOTE) {
                for (;;) {
                    int j = pattern.indexOf(QUOTE, i);
                    if (j == i) {
                        buffer.append(QUOTE);
                        i = j + 1;
                        break;
                    } else if (j > i) {
                        buffer.append(pattern.substring(i, j));
                        i = j + 1;
                        if (i < pattern.length() && pattern.charAt(i) == QUOTE) {
                            buffer.append(QUOTE);
                            ++i;
                            // loop again
                        } else {
                            break;
                        }
                    } else {
                        // Unterminated quote; should be caught by apply
                        // pattern.
                        throw new RuntimeException();
                    }
                }
                continue;
            }

            switch (c) {
            case CURRENCY_SIGN:
                // As of ICU 2.2 we use the currency object, and ignore the currency
                // symbols in the DFS, unless we have a null currency object. This occurs
                // if resurrecting a pre-2.2 object or if the user sets a custom DFS.
                boolean intl = i < pattern.length() && pattern.charAt(i) == CURRENCY_SIGN;
                boolean plural = false;
                if (intl) {
                    ++i;
                    if (i < pattern.length() && pattern.charAt(i) == CURRENCY_SIGN) {
                        plural = true;
                        intl = false;
                        ++i;
                    }
                }
                String s = null;
                Currency currency = getCurrency();
                if (currency != null) {
                    // plural name is only needed when pluralCount != null, which means
                    // when formatting currency plural names.  For other cases,
                    // pluralCount == null, and plural names are not needed.
                    if (plural && pluralCount != null) {
                        s = currency.getName(symbols.getULocale(), Currency.PLURAL_LONG_NAME,
                                             pluralCount, null);
                    } else if (!intl) {
                        s = currency.getName(symbols.getULocale(), Currency.SYMBOL_NAME, null);
                    } else {
                        s = currency.getCurrencyCode();
                    }
                } else {
                    s = intl ? symbols.getInternationalCurrencySymbol() :
                        symbols.getCurrencySymbol();
                }
                // Here is where FieldPosition could be set for CURRENCY PLURAL.
                buffer.append(s);
                break;
            case PATTERN_PERCENT:
                buffer.append(symbols.getPercentString());
                break;
            case PATTERN_PER_MILLE:
                buffer.append(symbols.getPerMillString());
                break;
            case PATTERN_MINUS_SIGN:
                buffer.append(symbols.getMinusSignString());
                break;
            default:
                buffer.append(c);
                break;
            }
        }
    }
1183065
def _prepend_name(self, prefix, dict_):
        ''''''
        return dict(['.'.join([prefix, name]), msg]
                    for name, msg in dict_.iteritems())
183824
def make_prefix(api_version, manipulator, auth_type):
    """"""
    prefix = "%s_%s" % (api_version, manipulator)
    if (auth_type and auth_type != 'none'):
        prefix += '_' + auth_type
    return prefix
246414
public void addAllowedPrefix(String prefix) {
        if (prefix.endsWith(".")) {
            prefix = prefix.substring(0, prefix.length() - 1);
        }
        LOG.debug("Allowed prefix: {}", prefix);
        String packageRegex = START + dotsToRegex(prefix) + SEP;
        LOG.debug("Prefix regex: {}", packageRegex);
        patternList.add(Pattern.compile(packageRegex).matcher(""));
    }
1096777
def prefix(rowPrefix):
        """"""
        fp = Range.followingPrefix(rowPrefix)
        return Range(srow=rowPrefix, sinclude=True, erow=fp, einclude=False)
1189784
private static String prefix(String s, int start) {
        StringBuilder prefix=new StringBuilder(MAX_PREFIX_LENGTH+20);
        if(start==0) {
            prefix.append("\"");
        } else {
            prefix.append("[at pattern index ").append(start).append("] \"");
        }
        int substringLength=s.length()-start;
        if(substringLength<=MAX_PREFIX_LENGTH) {
            prefix.append(start==0 ? s : s.substring(start));
        } else {
            int limit=start+MAX_PREFIX_LENGTH-4;
            if(Character.isHighSurrogate(s.charAt(limit-1))) {
                // remove lead surrogate from the end of the prefix
                --limit;
            }
            prefix.append(s, start, limit).append(" ...");
        }
        return prefix.append("\"").toString();
    }
1373546
def add_prefix(self, prefix, flags, prf):
        
        self._req('prefix add %s %s %s' % (prefix, flags, prf))
        time.sleep(1)
        self._req('netdataregister')
795741
def _indent(indent=0, quote='', indent_char=' '):
    """"""
    if indent > 0:
        indent_string = ''.join((
            str(quote),
            (indent_char * (indent - len(quote)))
        ))
    else:
        indent_string = ''.join((
            ('\x08' * (-1 * (indent - len(quote)))),
            str(quote))
        )

    if len(indent_string):
        INDENT_STRINGS.append(indent_string)
375212
def _add_prefix(self, last_char_index):
        
        last_parent_node_id = None
        while True:
            parent_node_id = self.active.source_node_id
            if self.active.explicit():
                edge_id = make_edge_id(self.active.source_node_id, self.string[last_char_index])
                if edge_id in self.edges:
                    # prefix is already in tree
                    break
            else:
                edge_id = make_edge_id(self.active.source_node_id, self.string[self.active.first_char_index])
                e = self.edges[edge_id]
                if self.string[e.first_char_index + self.active.length + 1] == self.string[last_char_index]:
                    # prefix is already in tree
                    break
                parent_node_id = self._split_edge(e, self.active)

            node = register_new_node()
            self.nodes[node.id] = node
            edge_id = make_edge_id(parent_node_id, self.string[last_char_index])
            e = register_new_edge(
                edge_id=edge_id,
                first_char_index=last_char_index,
                last_char_index=self.N,
                source_node_id=parent_node_id,
                dest_node_id=node.id,
            )
            self._insert_edge(e)

            if last_parent_node_id is not None:
                self.nodes[last_parent_node_id].suffix_node_id = parent_node_id
            last_parent_node_id = parent_node_id

            if self.active.source_node_id == self.root_node_id:
                self.active.first_char_index += 1
            else:
                self.active.source_node_id = self.nodes[self.active.source_node_id].suffix_node_id
            self._canonize_suffix(self.active)
        if last_parent_node_id is not None:
            self.nodes[last_parent_node_id].suffix_node_id = parent_node_id
        self.active.last_char_index += 1
        self._canonize_suffix(self.active)
1199983
public static String surround(final String value, final String prefix, final String suffix) {
        validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
        String _prefix = Optional.ofNullable(prefix).orElse("");
        return append(_prefix, value, Optional.ofNullable(suffix).orElse(_prefix));
    }
980854
public static Span prefix(CharSequence rowPrefix) {
    Objects.requireNonNull(rowPrefix);
    return prefix(Bytes.of(rowPrefix));
  }