Java URI to Local Name getNameSpace(URI uri)

Here you can find the source of getNameSpace(URI uri)

Description

get Name Space

License

Open Source License

Declaration

public static String getNameSpace(URI uri) 

Method Source Code

//package com.java2s;
//License from project: GNU General Public License 

import java.net.URI;

public class Main {
    public static String getNameSpace(URI uri) {
        return getNameSpace(uri.toString());
    }//from   w ww  . j  a v a  2 s. com

    public static String getNameSpace(String uri) {
        int index = uri.indexOf("#");

        if (index == -1)
            return uri;

        return uri.substring(0, index);
    }
}

Related

  1. getName(URI uri)
  2. getName(URI uri)
  3. getName(URI uri)
  4. getName(URI uri)
  5. getName(URI uri)
  6. getNameSpace(URI uri)