Java Pixel Convert From toPixel(String value)

Here you can find the source of toPixel(String value)

Description

to Pixel

License

Open Source License

Declaration

public static String toPixel(String value) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String toPixel(String value) {
        String ret = value;//from   w w  w.j  a v  a  2  s.  c  o m

        if (value.startsWith("@")) {

        } else {
            if (value.contains("px")) {
                ret = value.replace("px", "");
            } else if (value.contains("dp")) {
                ret = value.replace("dp", "");
            } else if (value.contains("dip")) {
                ret = value.replace("dip", "");
            } else if (value.contains("sp")) {
                ret = value.replace("sp", "");
            }
        }

        return ret;
    }
}

Related

  1. toPixel(byte b)
  2. toPixel(float meter)
  3. toPixelByte(float floatValue)
  4. toPixelFromByte(int byteValue)
  5. toPixelLength(float number)
  6. toPixelPosY(float posY)