Return a string representation of the identifier with its elements
        separated by the given separator.
331050
def separated(self, separator='-'):
        """"""
        return separator.join((part for part in self.elements() if part))
1172675
def make_regex(separator):
    
    return re.compile(r'(?:' + re.escape(separator) + r')?((?:[^' +
                      re.escape(separator) + r'\\]|\\.)+)')
379312
public static String collectionAsString(Collection<?> collection, String separator) {

        StringBuffer string = new StringBuffer(128);
        Iterator<?> it = collection.iterator();
        while (it.hasNext()) {
            string.append(it.next());
            if (it.hasNext()) {
                string.append(separator);
            }
        }
        return string.toString();
    }
1318770
def separator(string = "")
      if separators[options.size]
        separators[-1] += "\n#{string}"
      else
        separators[options.size] = string
      end
    end
1262677
public static String joinStrings( String separator, String... strings ) {
        if (separator == null) {
            separator = "";
        }
        StringBuilder sb = new StringBuilder();
        for( int i = 0; i < strings.length; i++ ) {
            sb.append(strings[i]);
            if (i < strings.length - 1) {
                sb.append(separator);
            }
        }
        return sb.toString();
    }
1234453
def separate_string(string):
    
    string_list = regex.split(r'<(?![!=])', regex.sub(r'>', '<', string))
    return string_list[::2], string_list[1::2]
411587
def _extract(self, identifier):
		'''  '''

		conjugation = []
		if self.tree.xpath('//p/b[normalize-space(text()) = "' + identifier.decode('utf-8') + '"]'):
			p = self.tree.xpath('//p/b[normalize-space(text()) = "' + identifier.decode('utf-8') + '"]')[0].getparent()
			for font in p.iterfind('font'):
				text = self._normalize(font.text_content())
				next = font.getnext()
				text += ' ' + self._normalize(next.text_content())
				while True:
					next = next.getnext()
					if next.tag != 'span':
						break
					text += '/' + self._normalize(next.text_content())
				conjugation.append(text)
		return conjugation
1001
def _oxford_comma_separator(i, length):
    
    if length == 1:
        return None
    elif length < 3 and i == 0:
        return ' and '
    elif i < length - 2:
        return ', '
    elif i == length - 2:
        return ', and '
    else:
        return None
1133373
public final String getChainIdentity(String separator) throws KSIException {
        StringBuilder identity = new StringBuilder();

        for (int i = chain.size()-1; i >=0 ; i--) {
            AggregationChainLink aggregationChainLink = chain.get(i);
            Identity linkIdentity = aggregationChainLink.getLinkIdentity();
            String id = linkIdentity == null ? "" : linkIdentity.getDecodedClientId();
            if (identity.length() > 0 && id.length() > 0) {
                identity.append(separator);
            }
            identity.append(id);
        }
        return identity.toString();
    }
756362
def partition(string, sep):
    
    p = string.split(sep, 1)
    if len(p) == 2:
        return p[0], sep, p[1]
    return string, '', ''
421350
public static String joinBySeparator( List<String> items, String separator ) {
        int size = items.size();
        if (size == 0) {
            return "";
        }
        StringBuilder sb = new StringBuilder(items.get(0));
        for( int i = 1; i < size; i++ ) {
            sb.append(separator).append(items.get(i));
        }
        return sb.toString();
    }
830082
private function tokenize($string, $separator = '')
    {
        if (!strcmp($separator, '')) {
            $separator = $string;
            $string = $this->headerNextToken;
        }

        for ($character = 0; $character < strlen($separator); $character++) {
            if (gettype($position = strpos($string, $separator[$character])) == 'integer') {
                $found = (isset($found) ? min($found, $position) : $position);
            }
        }

        if (isset($found)) {
            $this->headerNextToken = substr($string, $found + 1);

            return substr($string, 0, $found);
        } else {
            $this->headerNextToken = '';

            return $string;
        }
    }
45854
function buildElementIdentifier(element) {
			if (element.id) {
				return `#${element.id}`;
			}
			let identifier = element.tagName.toLowerCase();
			if (!element.parentNode) {
				return identifier;
			}
			const siblings = getSiblings(element);
			const childIndex = siblings.indexOf(element);
			if (!isOnlySiblingOfType(element, siblings) && childIndex !== -1) {
				identifier += `:nth-child(${childIndex + 1})`;
			}
			return identifier;
		}
571782
public static String join(List<String> parts, String separator) {
		Iterator<String> it = parts.iterator();
		StringBuilder builder = new StringBuilder();
		while (it.hasNext()) {
			String part = it.next();
			builder.append(part);
			if (it.hasNext()) {
				builder.append(separator);
			}
		}
		return builder.toString();
	}
186640
public static function getIconIdentifier(string $iconKey, string $separator = '_'): string {
    return self::iconIdentifier($iconKey, $separator);
  }
57564
public static String toSeparatedString(List<?> values, String separator, String prefix) {
        StringBuilder result = new StringBuilder();
        for (Object each : values) {
            if (each == null) {
                continue;
            }
            if (result.length() > 0) {
                result.append(separator);
            }
            if (prefix != null) {
                result.append(String.valueOf(each));
            } else {
                result.append(prefix + String.valueOf(each));
            }
        }
        return result.toString();
    }
77786
public static List<String> splitNicely( String toSplit, String separator ) {

		if( separator == null || separator.isEmpty())
			throw new IllegalArgumentException( "The separator cannot be null or the empty string." );

		return splitNicelyWithPattern( toSplit, Pattern.quote( separator ));
	}