Add '/' at the ending.

@param target target string.

@return rule result.
485716
protected String addEndSlash(@NonNull String target) {
        if (!target.endsWith(File.separator)) target = target + File.separator;
        return target;
    }
105911
public static String chop(String target) {
		if (isEmpty(target)) { return EMPTY; }
		int len = target.length(), lastIdx = -1;
		if (len >= 2 && target.charAt(len - 1) == LF && target.charAt(len - 2) == CR) {
			if (len == 2) { return EMPTY; } lastIdx = -2; 
		}
		return replace(target).afters(lastIdx).byNone().last();
	}
794905
public String toAbsolute(String target) {

        if (isNotInitialized()) {
            return getMessage(NOT_INITIALIZED);
        }
        return CmsLinkManager.getAbsoluteUri(target, getController().getCurrentRequest().getElementUri());
    }
298648
public static <T> T orElseIfNull(T target, T elseTarget) {
        return Optional.ofNullable(target).orElse(elseTarget);
    }
151128
@Nullable
    public final Target findTargetFor(@Nullable final String targetPath) {
        if (targets == null) {
            return null;
        }
        if (targetPath == null) {
            return null;
        }
        for (final Target target : targets) {
            if (target.matches(targetPath)) {
                return target;
            }
        }
        return null;
    }
1259196
public static String escapeXml(final Object target) {
        if (target == null) {
            return null;
        }
        return HtmlEscape.escapeHtml4Xml(target.toString());
    }
211981
public static String normalizePattern(final String pattern) {
		if (pattern == null || "".equals(pattern.trim())) {
			return "/";
		}
		if (pattern.length() > 0 && !pattern.startsWith("/")
				&& !pattern.startsWith("*")) {
			return "/" + pattern;
		}
		return pattern;
	}
156589
public String addSiteRoot(String sitePath) {

        if (sitePath == null) {
            return null;
        }
        String siteRoot = getAdjustedSiteRoot(getSiteRoot(), sitePath);
        StringBuffer result = new StringBuffer(128);
        result.append(siteRoot);
        if (((siteRoot.length() == 0) || (siteRoot.charAt(siteRoot.length() - 1) != '/'))
            && ((sitePath.length() == 0) || (sitePath.charAt(0) != '/'))) {
            // add slash between site root and resource if required
            result.append('/');
        }
        result.append(sitePath);
        return result.toString();
    }
913232
public Set<String> setUnescapeJavaScript(final Set<?> target) {
        if (target == null) {
            return null;
        }
        final Set<String> result = new LinkedHashSet<String>(target.size() + 2);
        for (final Object element : target) {
            result.add(unescapeJavaScript(element));
        }
        return result;
    }
324622
public static <T> Rule<T> fromUri(final String uri, final List<String> methods, final T target) {
    return new Rule<>(uri, methods, target);
  }
1062081
protected static function addMissingParts($source, $target)
    {
        $pattern = '/'.preg_replace('/[0-9]+/', '[0-9]+', preg_quote($target, '/')).'$/';

        $result = preg_replace($pattern, $target, $source, 1, $count);

        return $count ? $result : $target;
    }
1028357
String getTargetInternalName(String sourceInternalName, String targetPackage) {
        StringBuilder targetInternalName = new StringBuilder();
        targetInternalName.append(targetPackage.replaceAll("\\.", "/"));

        int lastSlashIndex = sourceInternalName.lastIndexOf('/');
        targetInternalName.append(sourceInternalName.substring(lastSlashIndex));

        return targetInternalName.toString();
    }
50281
def add(self, rule, method, target, name=None, static=False):
        '''  '''
        if static:
            depr("Use a backslash to escape ':' in routes.") # 0.9
            rule = rule.replace(':','\\:')

        if rule in self.routes:
            self.routes[rule][method.upper()] = target
        else:
            self.routes[rule] = {method.upper(): target}
            self.rules.append(rule)
            if self.static or self.dynamic: # Clear precompiler cache.
                self.static, self.dynamic = {}, {}
        if name:
            self.named[name] = (rule, None)
708575
private static String nodeTargetPattern(ShapeTargetValueShape target) {
        return " " + formatNode(target.getNode()) + " " + writePropertyChain(target.pathChain) + " ?this . ";
    }
187411
protected String getResourceSuffix(String target) {
        int index = target.lastIndexOf('/');
        if ( index > -1 ) {
            target = target.substring(index + 1);
        }
        return target;
    }
775875
public final Page setBase(String target, String href)
    {
        base="<base " +
            ((target!=null)?("TARGET=\""+target+"\""):"") +
            ((href!=null)?("HREF=\""+href+"\""):"") +
            ">";
        return this;
    }
109376
public NonorderedRouter<T> pattern(String path, T target) {
    final Pattern<T> pattern = new Pattern<T>(path, target);
    patterns.add(pattern);

    List<Pattern<T>> patterns = reverse.get(target);
    if (patterns == null) {
      patterns = new ArrayList<Pattern<T>>();
      patterns.add(pattern);
      reverse.put(target, patterns);
    } else {
      patterns.add(pattern);
    }

    return this;
  }