Java String Unquote unquote(String _path)

Here you can find the source of unquote(String _path)

Description

unquote

License

Open Source License

Declaration

static String unquote(String _path) 

Method Source Code

//package com.java2s;

public class Main {
    static String unquote(String _path) {
        byte[] path = _path.getBytes();
        int pathlen = path.length;
        int i = 0;
        while (i < pathlen) {
            if (path[i] == '\\') {
                if (i + 1 == pathlen)
                    break;
                System.arraycopy(path, i + 1, path, i, path.length
                        - (i + 1));/*from w w w .j a v  a  2 s  . com*/
                pathlen--;
                continue;
            }
            i++;
        }
        if (pathlen == path.length)
            return _path;
        byte[] foo = new byte[pathlen];
        System.arraycopy(path, 0, foo, 0, pathlen);
        return new String(foo);
    }
}

Related

  1. unquote(final String aInput)
  2. unquote(final String in)
  3. unQuote(final String quoted)
  4. unquote(final String s)
  5. unquote(final String str)
  6. unquote(String argument)
  7. unquote(String argument)
  8. unquote(String aString)
  9. unquote(String entityName)