Removes leading and trailing slashes from a string.
@param {String} sNamespace - input string
@returns {String} - string after removing leading and trailing slashes
@public
549614
function (sNamespace) {
				if (!sNamespace) {
					return "";
				}
				if (sNamespace[0] === "/") {
					var sNamespaceWithoutLeadingSlash = sNamespace.substring(1, sNamespace.length);
					return this.cleanLeadingAndTrailingSlashes(sNamespaceWithoutLeadingSlash);
				}
				if (sNamespace[sNamespace.length - 1] === "/") {
					var sNamespaceWithoutTrailingSlash = sNamespace.substring(0, sNamespace.length - 1);
					return this.cleanLeadingAndTrailingSlashes(sNamespaceWithoutTrailingSlash);
				}
				return sNamespace;
			}
809341
function (s) {
          s = Tools.trim(s);

          function rep(re, str) {
            s = s.replace(re, str);
          }

          // example: <strong> to [b]
          rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi, "[url=$1]$2[/url]");
          rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi, "[code][color=$1]$2[/color][/code]");
          rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi, "[quote][color=$1]$2[/color][/quote]");
          rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, "[code][color=$1]$2[/color][/code]");
          rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, "[quote][color=$1]$2[/color][/quote]");
          rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi, "[color=$1]$2[/color]");
          rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, "[color=$1]$2[/color]");
          rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi, "[size=$1]$2[/size]");
          rep(/<font>(.*?)<\/font>/gi, "$1");
          rep(/<img.*?src=\"(.*?)\".*?\/>/gi, "[img]$1[/img]");
          rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi, "[code]$1[/code]");
          rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi, "[quote]$1[/quote]");
          rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi, "[code][b]$1[/b][/code]");
          rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi, "[quote][b]$1[/b][/quote]");
          rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi, "[code][i]$1[/i][/code]");
          rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi, "[quote][i]$1[/i][/quote]");
          rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi, "[code][u]$1[/u][/code]");
          rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi, "[quote][u]$1[/u][/quote]");
          rep(/<\/(strong|b)>/gi, "[/b]");
          rep(/<(strong|b)>/gi, "[b]");
          rep(/<\/(em|i)>/gi, "[/i]");
          rep(/<(em|i)>/gi, "[i]");
          rep(/<\/u>/gi, "[/u]");
          rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi, "[u]$1[/u]");
          rep(/<u>/gi, "[u]");
          rep(/<blockquote[^>]*>/gi, "[quote]");
          rep(/<\/blockquote>/gi, "[/quote]");
          rep(/<br \/>/gi, "\n");
          rep(/<br\/>/gi, "\n");
          rep(/<br>/gi, "\n");
          rep(/<p>/gi, "");
          rep(/<\/p>/gi, "\n");
          rep(/&nbsp;|\u00a0/gi, " ");
          rep(/&quot;/gi, "\"");
          rep(/&lt;/gi, "<");
          rep(/&gt;/gi, ">");
          rep(/&amp;/gi, "&");

          return s;
        }
792709
protected String trim(String s) {
        if (s == null || s.length() == 0)
            return s;

        return s.trim();
    }
1142170
public final void nameSpace (String namespace) {
    if (namespace == null || namespace.equals("")) {
      _namespace = "";
    } else {
      _namespace = namespace + ":";
    }
  }
826075
private String getNamespaceValue(final String value) {
        if (value == null || value.contains(":") || value.equals("text")) {
            return value;
        } else {
            return getCurrentNamespace() + ":" + value;
        }
    }
279930
function getNamespace (path, relative) {
  // ignore parent path
  let final = ''
  if (relative) {
    const s = path.split('/')
    final = s[s.length - 1]
  } else {
    final = path.startsWith('./') ? path.slice(2) : path
  }
  // remove '.js'
  return final.slice(0, final.length - 3)
}
1170506
public static String trim(String buffer) {
        // remove spaces in front
        int count = 0;
        for (int i = 0; i < buffer.length(); i++) {
            if (buffer.charAt(i) == SPACE_CHAR)
                count++;
            else
                break;
        }
        if (count > 0)
            buffer = buffer.substring(count);

        // remove spaces in the end
        count = buffer.length();
        for (int i = buffer.length() - 1; i > 0; i--) {
            if (buffer.charAt(i) == SPACE_CHAR && buffer.charAt(i - 1) != BACK_SLASH)
                count--;
            else
                break;
        }
        if (count != buffer.length())
            buffer = buffer.substring(0, count);

        return buffer;
    }
120057
function( text ){
			if(text && text.length){
				var i = text.length,
					x = 0;

				// turn all whitespace chars at end into spaces
				while (i--) {
					if(this.isOnlyWhiteSpace(text[i])){
						text = this.replaceCharAt( text, i, ' ' );
					}else{
						break;
					}
				}

				// turn all whitespace chars at start into spaces
				i = text.length;
				while (x < i) {
					if(this.isOnlyWhiteSpace(text[x])){
						text = this.replaceCharAt( text, i, ' ' );
					}else{
						break;
					}
					x++;
				}
			}
			return this.trim(text);
		}
1155311
function (s) {
            return s.replace(strColons, '/').replace(strWords, '$1_$2').replace(strLowUp, '$1_$2').replace(strDash, '_').toLowerCase();
        }
962423
function() {
    var str
      , prefix;
    this.expect('namespace');

    this.skipSpacesAndComments();
    if (prefix = this.accept('ident')) {
      prefix = prefix.val;
    }
    this.skipSpacesAndComments();

    str = this.accept('string') || this.url();
    this.allowPostfix = true;
    return new nodes.Namespace(str, prefix);
  }
698571
function() {
		var str = this.trim();
		str = this.charAt(0).toUpperCase() + this.slice(1);
		if (!str.match(/[?!\.]$/)) str = str+'.';
		return str;
	}
514938
function getNamespacedData(namespace, data){
        var namespacedData = {};
        for (var key in data){
            // key starts with namespace
            if (key.slice(0, namespace.length) == namespace){
                var namespacedKey = key.slice(namespace.length, key.length);
                namespacedKey = namespacedKey.charAt(0).toLowerCase() + namespacedKey.slice(1);
                namespacedData[namespacedKey] = data[key];
            }
        }

        return namespacedData;
    }
206000
function(namespaceURI,localName){
		var attr = this.getNamedItemNS(namespaceURI,localName);
		_removeNamedNode(this._ownerElement,this,attr);
		return attr;
	}
385002
public void removeNamespace( String prefix, String elementName ) {
      if( prefix == null ){
         prefix = "";
      }
      if( StringUtils.isBlank( elementName ) ){
         rootNamespace.remove( prefix.trim() );
      }else{
         Map nameSpaces = (Map) namespacesPerElement.get( elementName );
         nameSpaces.remove( prefix );
      }
   }
371716
function (s) {
          s = Tools.trim(s);

          function rep(re, str) {
            s = s.replace(re, str);
          }

          // example: [b] to <strong>
          rep(/\n/gi, "<br />");
          rep(/\[b\]/gi, "<strong>");
          rep(/\[\/b\]/gi, "</strong>");
          rep(/\[i\]/gi, "<em>");
          rep(/\[\/i\]/gi, "</em>");
          rep(/\[u\]/gi, "<u>");
          rep(/\[\/u\]/gi, "</u>");
          rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi, "<a href=\"$1\">$2</a>");
          rep(/\[url\](.*?)\[\/url\]/gi, "<a href=\"$1\">$1</a>");
          rep(/\[img\](.*?)\[\/img\]/gi, "<img src=\"$1\" />");
          rep(/\[color=(.*?)\](.*?)\[\/color\]/gi, "<font color=\"$1\">$2</font>");
          rep(/\[code\](.*?)\[\/code\]/gi, "<span class=\"codeStyle\">$1</span>&nbsp;");
          rep(/\[quote.*?\](.*?)\[\/quote\]/gi, "<span class=\"quoteStyle\">$1</span>&nbsp;");

          return s;
        }
602234
private static String stripStartingSlash(String s) {
        if (s != null && s.startsWith("/")) {
            s = s.substring(1, s.length());
        }
        return s;
    }
1330258
public final String trimFrom(String s) {
    int first;
    int last;

    // removes leading matches
    for (first = 0; first < s.length(); ) {
      final int codePoint = s.codePointAt(first);
      if (!matches(codePoint)) {
        break;
      }
      first += Character.charCount(codePoint);
    }

    //remove trailing matches
    for (last = s.length() - 1; last >= first; --last) {
      if (Character.isLowSurrogate(s.charAt(last))) {
        --last;
      }
      if (!matches(s.codePointAt(last))) {
        break;
      }
    }

    return s.substring(first, last + 1);
  }