Android IP Address Get getIPv4StringByStrippingIPv6Prefix(String in)

Here you can find the source of getIPv4StringByStrippingIPv6Prefix(String in)

Description

get I Pv String By Stripping I Pv Prefix

License

Open Source License

Declaration

public static String getIPv4StringByStrippingIPv6Prefix(String in) 

Method Source Code

//package com.java2s;

public class Main {
    public static String getIPv4StringByStrippingIPv6Prefix(String in) {
        String ipv6Prefix = "::ffff:";

        if (in.startsWith(ipv6Prefix)) {
            return in.substring(ipv6Prefix.length(), in.length());
        }//  ww  w  .  j a  v a  2s .c  om

        return in;
    }
}

Related

  1. getIPAddress(boolean useIPv4)
  2. getTargetInetaddress(String target)
  3. getDevicesMac(Context context)
  4. getDevicesIP(Context context)
  5. getIPs()
  6. getIPV4NetwprkOrder(String theIp)