Returns a substring of the given string, representing the 'length' most-right characters
340396
public static String rightStr(String str, int length) {
		return str.substring(Math.max(0, str.length() - length));
	}
761054
function truncate(str, len) {
        // Truncate text to specified length
        if (str.length > len) {
            str = str.substr(0, len);

            // To prevent awkwardly truncating in the middle of a word,
            // attempt to truncate at the end of the last whole word
            var lastSpaceChar = str.lastIndexOf(" ");
            if (lastSpaceChar < len && lastSpaceChar > -1) {
                str = str.substr(0, lastSpaceChar);
            }
            return str;
        }
    }
567548
function substr(val, start, length){
  utils.assertString(val, 'val');
  utils.assertType(start, 'unit', 'start');
  length = length && length.val;
  var res = val.string.substr(start.val, length);
  return val instanceof nodes.Ident
      ? new nodes.Ident(res)
      : new nodes.String(res);
}
891774
def shorten(string, length=140, ellipsis=None):
    '''
    
    '''
    string = string.strip()

    if len(string) > length:
        if ellipsis is True:
            ellipsis = '…'
        else:
            ellipsis = ellipsis or ''

        L = length - len(ellipsis)

        return ' '.join(string[:L].split(' ')[:-1]).strip(',;:.') + ellipsis

    else:
        return string
772406
protected function short($string, $length = 200)
    {
        if( strlen( $string ) < $length ) {
            return $string;
        }

        return substr( $string, 0, $length ) .'...';
    }
378600
public static String 
    trimRight( String string ) 
    {
    	for( int i = string.length(); i > 0; --i )
    	{
    		if( string.charAt(i-1) != ' '
    		&& string.charAt(i-1) != '\t'
    		&& string.charAt(i-1) != '\n'
    		&& string.charAt(i-1) != '\r' ) 
    		{    			
    			return i == string.length() ? string : 
    			                              string.substring( 0, i );
    		}
    	}
    	return "";
    }
911125
public static String rightTrim(final String aString) {
		if (aString == null) {
			return null;
		}
		int end = aString.length() - 1;
		while ((end >= 0) && (aString.charAt(end) <= ' ')) {
			end--;
		}
		if (end == aString.length() - 1) {
			return aString;
		}
		return aString.substring(0, end + 1);
	}
306285
def get_string(self):
    
    return self.left.chr+':'+str(self.left.end)+'-'+self.right.chr+':'+str(self.right.start)
954147
private String excerpt(String str, int maxLength) {
        return str.length() > maxLength ? excerptPattern.matcher(
                str.substring(0, maxLength)).replaceFirst("&hellip;") : str;
    }
603224
public static String substring(String str, int off, int len) {
	return str.substring(off, off + len);
    }
51731
function truncate (value, length) {
  length = length || 15
  if( !value || typeof value !== 'string' ) return ''
  if( value.length <= length) return value
  return value.substring(0, length) + '...'
}
270551
function( str ){
      var first, last;

      // find first non-space char
      for( first = 0; first < str.length && str[first] === ' '; first++ ){}

      // find last non-space char
      for( last = str.length - 1; last > first && str[last] === ' '; last-- ){}

      return str.substring(first, last + 1);
    }
183536
def trunc_str(s: str) -> str:
    """"""
    if len(s) > max_str_size:
        i = max(0, (max_str_size - 3) // 2)
        j = max(0, max_str_size - 3 - i)
        s = s[:i] + "..." + s[-j:]
    return s
36884
def truncate(string, count=30)
      if string.length >= count
        shortened = string[0, count]
        splitted = shortened.split(/\s/)
        words = splitted.length
        splitted[0, words - 1].join(' ') + '...'
      else
        string
      end
    end
1154183
function(str, end) {
    return (str.length >= end.length &&
            str.substring(str.length - end.length) === end);
  }
426670
function truncate(string) {
  if (string.length > SEG_LENGTH * 2 + 3) {
    return string.slice(0, SEG_LENGTH) + '...' + string.slice(-SEG_LENGTH);
  }

  return string;
}
96034
public static String rightTrim(CharSequence input) {
      if (input == null) {
         return null;
      }
      return StringFunctions.RIGHT_TRIM.apply(input.toString());
   }