if a string doesn't end in a '/' add one
326051
def _add_slash(self, string=None):
        
        if(not str.endswith(string, '/')):
            return str.join('', [string, '/'])
        return str(string)
669894
function stringPadEnd (str, targetLength, padString, UNDEFINED) {
  var rest = '' + str
  targetLength = targetLength >> 0
  padString = padString === UNDEFINED ? ' ' : '' + padString
  if (rest.padEnd) {
    return rest.padEnd(targetLength, padString)
  }
  if (targetLength > rest.length) {
    targetLength -= rest.length
    if (targetLength > padString.length) {
      padString += stringRepeat(padString, targetLength / padString.length)
    }
    return rest + padString.slice(0, targetLength)
  }
  return rest
}
854972
public void addNextString(String string)
    {
        int iLength = string.length();
        char charLength = (char)iLength;
        String strNew = m_string + charLength + string;
        m_string = strNew;
    }
1177651
function hasDotNesting(string) {
  const loc = string.indexOf('.');
  return (loc !== -1) && (loc !== 0) && (loc !== string.length - 1);
}
503682
function endsWith(str,test){
  var lastIndex = str.lastIndexOf(test);
  return (lastIndex != -1) && (lastIndex + test.length == str.length);
}
848410
@Trivial
    private String addSlash(String input){
        if(input.endsWith("/") || input.endsWith("\\"))
            return "";
        return File.separator;
    }
368591
def abbreviate_str(string, max_len=80, indicator="..."):
  
  if not string or not max_len or len(string) <= max_len:
    return string
  elif max_len <= len(indicator):
    return string[0:max_len]
  else:
    return string[0:max_len - len(indicator)] + indicator
1327302
function addDiffIndicator(str, added) {
    const modifier = added ? '+' : '-';
    if (str[0] === ' ') {
        return modifier + str.slice(1);
    } else {
        return `${modifier}${str}`;
    }
}
436513
public void endsWith(String string) {
    checkNotNull(string);
    if (actual() == null) {
      failWithActual("expected a string that ends with", string);
    } else if (!actual().endsWith(string)) {
      failWithActual("expected to end with", string);
    }
  }
431244
def _fix_path(self, path):
        
        if path.endswith('/'):
            path = path.rstrip('/')

        return safe_str(path)
595939
private static void addNonBlank(final String string, final List<String> strings) {
        if (!StringUtils.isBlank(string) && !"/".equals(string))
            strings.add(string);
    }
1154183
function(str, end) {
    return (str.length >= end.length &&
            str.substring(str.length - end.length) === end);
  }
933070
function appendQueryString(url, params){
        var key;
        url = url || '';
        if(params){
            if(url.indexOf('?') === -1){
                url += '?';
            }
            if(typeof params === 'string'){
                url += params;
            } else if (typeof params === 'object'){
                for(key in params){
                    if(!/[?&]$/.test(url)){
                        url += '&';
                    }
                    url += encodeURIComponent(key) + '=' + encodeURIComponent(params[key]);
                }
            }
        }

        return url;
    }
367189
def _check_endings(self):
        """"""
        if self.slug.startswith("/") and self.slug.endswith("/"):
            raise InvalidSlugError(
                _("Invalid slug. Did you mean {}, without the leading and trailing slashes?".format(self.slug.strip("/"))))
        elif self.slug.startswith("/"):
            raise InvalidSlugError(
                _("Invalid slug. Did you mean {}, without the leading slash?".format(self.slug.strip("/"))))
        elif self.slug.endswith("/"):
            raise InvalidSlugError(
                _("Invalid slug. Did you mean {}, without the trailing slash?".format(self.slug.strip("/"))))
708976
function addAnchors(text) {
        if(text.charAt(0) != '\x02')
            text = '\x02' + text;
        if(text.charAt(text.length - 1) != '\x03')
            text = text + '\x03';
        return text;
    }
649577
function append(str, postfix) {
    if (!str && str !== 0) {
        str = '';
    } else {
        str = str.toString();
    }
    return str + postfix;
}
1029129
function findEscapeEnd(source, offset) {
    for (var i = 0; i < 7 && offset + i < source.length; i++) {
        var code = source.charCodeAt(offset + i);

        if (i !== 6 && isHex(code)) {
            continue;
        }

        if (i > 0) {
            offset += i - 1 + getNewlineLength(source, offset + i, code);
            if (code === SPACE || code === TAB) {
                offset++;
            }
        }

        break;
    }

    return offset;
}