Append a suffix to the string (e.g. filename) if it doesn't have it already.
@param _str string to check
@param _suffix suffix to append
@return string with suffix or original if no suffix was appended
488583
public static String appendSuffixIfMissing(String _str, String _suffix) {
        if (_str == null) {
            return null;
        }
        if (!_str.endsWith(_suffix)) {
            _str += _suffix;
        }
        return _str;
    }
677645
public ByteBuffer append(String str) {
        if (str != null)
            return append(DocWriter.getISOBytes(str));
        return this;
    }
144188
public static function concatenate($str, $suffix, $separator)
    {
        if (empty($suffix)) {
            return $str;
        }
        if (empty($str)) {
            return $suffix;
        }

        return $str . $separator . $suffix;
    }
1245455
private void addStringInternal(String str)
    {
        String prefixString = determineLongestPrefixInMDAG(str);
        String suffixString = str.substring(prefixString.length());

        //Retrive the data related to the first confluence node (a node with two or more incoming transitions)
        //in the _transition path from sourceNode corresponding to prefixString.
        HashMap<String, Object> firstConfluenceNodeDataHashMap = getTransitionPathFirstConfluenceNodeData(sourceNode, prefixString);
        MDAGNode firstConfluenceNodeInPrefix = (MDAGNode) firstConfluenceNodeDataHashMap.get("confluenceNode");
        Integer toFirstConfluenceNodeTransitionCharIndex = (Integer) firstConfluenceNodeDataHashMap.get("toConfluenceNodeTransitionCharIndex");
        /////

        //Remove the register entries of all the nodes in the prefixString _transition path up to the first confluence node
        //(those past the confluence node will not need to be removed since they will be cloned and unaffected by the 
        //addition of suffixString). If there is no confluence node in prefixString, then remove the register entries in prefixString's entire _transition path
        removeTransitionPathRegisterEntries((toFirstConfluenceNodeTransitionCharIndex == null ? prefixString : prefixString.substring(0, toFirstConfluenceNodeTransitionCharIndex)));

        //If there is a confluence node in the prefix, we must duplicate the _transition path
        //of the prefix starting from that node, before we add suffixString (to the duplicate path).
        //This ensures that we do not disturb the other _transition paths containing this node.
        if (firstConfluenceNodeInPrefix != null)
        {
            String transitionStringOfPathToFirstConfluenceNode = prefixString.substring(0, toFirstConfluenceNodeTransitionCharIndex + 1);
            String transitionStringOfToBeDuplicatedPath = prefixString.substring(toFirstConfluenceNodeTransitionCharIndex + 1);
            cloneTransitionPath(firstConfluenceNodeInPrefix, transitionStringOfPathToFirstConfluenceNode, transitionStringOfToBeDuplicatedPath);
        }
        /////

        //Add the _transition based on suffixString to the end of the (possibly duplicated) _transition path corresponding to prefixString
        addTransitionPath(sourceNode.transition(prefixString), suffixString);
    }
668183
private function append_str($str)
  { 
    $this->check_closed(); 
    $this->string_buffer .= $str; 
    $len = strlen($str); 
    $this->current_index += $len; 
    return $len; 
  }
109023
def add_suffix(in_files, suffix):
    
    import os.path as op
    from nipype.utils.filemanip import fname_presuffix, filename_to_list
    return op.basename(fname_presuffix(filename_to_list(in_files)[0],
                                       suffix=suffix))
1199599
def add_suffix(file_path, suffix='modified', sep='_', ext=None):
    """"""
    return _add_suffix(file_path, suffix, sep, ext)
967310
public StrBuilder append(final String str) {
        if (str == null) {
            return appendNull();
        }
        final int strLen = str.length();
        if (strLen > 0) {
            final int len = length();
            ensureCapacity(len + strLen);
            str.getChars(0, strLen, buffer, len);
            size += strLen;
        }
        return this;
    }
812997
public function suffix($string, $in_place = false)
    {
        $suffixed = array_map(function ($value) use ($string) {
            return $value . $string;
        }, $this->list);

        if ($in_place) {
            $this->list = $suffixed;

            return $this;
        }

        return new ItemList($suffixed);
    }
956090
def get_suffix(name):
    
    a = name.count(".")
    if a:
        ext = name.split(".")[-1]
        if ext in LANGS.keys():
            return ext
        return False
    else:
        return False
68106
def prefix(filename):
    '''  '''
    return os.path.split(re.sub(_afni_suffix_regex,"",str(filename)))[1]
1267190
def strip_required_suffix(string, suffix):
    
    if string.endswith(suffix):
        return string[:-len(suffix)]
    raise AssertionError('String ends with %r, not %r' % (string[-len(suffix):], suffix))
92835
def get_full_filename_by_suffixes(dir_src, suffixes):
        # type: (AnyStr, Union[AnyStr, List[AnyStr]]) -> Optional[List[AnyStr]]
        
        file_names = FileClass.get_filename_by_suffixes(dir_src, suffixes)
        if file_names is None:
            return None
        return list(dir_src + os.sep + name for name in file_names)
722778
public StringGrabber appendRepeat(String str, int repeatCount) {
		for (int i = 0; i < repeatCount; i++) {
			if (str != null) {
				sb.append(str);
			}
		}
		return StringGrabber.this;
	}
1051915
public function suffix($string)
    {
        if (null === $this->suffix) {
            $this->suffix = $this->element('', [], ' ');
        }

        $args = func_get_args();

        if (!is_array($string) && count($args) > 1) {
            $string = call_user_func_array([$this, 'format'], $args);
        }

        $this->suffix->append($string);

        return $this;
    }
1187073
public static boolean endsWith(String str, char suffix) {
	return str != null && str.length() > 0 && str.charAt(str.length() - 1) == suffix;
    }
437188
def add_suffix(fullname, suffix):
    
    name, ext = os.path.splitext(fullname)
    return name + '_' + suffix + ext