Java Assert assertNoSlash(final String ofString)

Here you can find the source of assertNoSlash(final String ofString)

Description

assert No Slash

License

Open Source License

Declaration

public static String assertNoSlash(final String ofString) 

Method Source Code

//package com.java2s;

public class Main {
    public static String assertNoSlash(final String ofString) {
        if (!ofString.endsWith("/")) {
            return ofString;
        }/*from   ww  w .  j  av  a  2s  . c  o  m*/

        return ofString.substring(0, ofString.length() - 1);
    }

    public static int length(final String s, final String separator) {
        final String[] list = s.split(separator);
        return list.length;
    }
}

Related

  1. assertMessageEquals(Throwable ex, String msg)
  2. assertNonEmpty(String s, String name)
  3. assertNonFatal(boolean test, String msg)
  4. assertNonNegative(int field, String fieldName)
  5. assertNonZero(int i, String fieldName)
  6. assertNotBlank(final String arg, final String message)
  7. assertNotBlank(final String value, final String exceptionMessage)
  8. assertNotBlank(final String... strings)
  9. assertNotBlankOrThrowException(final String... strings)