روش های تبدیل

روش های تبدیل

روش های تبدیل
روش های تبدیل برای تبدیل بین انواع داده های مختلف بولی، اعداد صحیح، دوگانه، رشته ها و آرایه ها استفاده می شود. این روش ها نسخه کوتاهی از روش های تبدیل در کتابخانه های استاندارد جاوا هستند.

 
Name
Syntax
Description
toBoolean
boolean toBoolean(String str)
Converts the given string to a Boolean. (’true’ returns true, all other strings return false).
toBoolean
boolean [] toBoolean(String[]… strs)
Converts all the strings in the given array to Booleans (’true’ returns true, all other strings return false) and returns a Boolean array.
toBoolean
boolean [][] toBoolean(String[][]… strs)
Converts all the strings in the given matrix to Booleans (’true’ returns true, all other strings return false) and returns a Boolean matrix.
toDouble
double toDouble(String str)
Converts the given string to a double.
toDouble
double[] toDouble(String… strs)
Converts all the strings in the given array to doubles and returns a double array.
toDouble
double[][] toDouble(String[]… strs)
Converts all the strings in the given matrix to doubles and returns a double matrix.
toDouble
double toDouble(float flt)
Converts the given float to a double.
toDouble
double[] toDouble(float… flt)
Converts all the floats in the given array to doubles and returns a double array.
toDouble
double[][] toDouble(float[]… flt)
Converts all the floats in the given matrix to doubles and returns a double matrix.
toInt
int toInt(String str)
Converts the given string to an integer.
toInt
int[] toInt(String… strs)
Converts all the strings in the given array to integers and returns an integer array.
toInt
int[][] toInt(String[]… strs)
Converts all the strings in the given matrix to integers and returns an integer matrix.
toString
String toString(int value)
Converts the given integer to a string.
toString
String toString(double value)
Converts the given double to a string.
toString
String toString(boolean value)
Converts the given Boolean to a string.
toString
String toString(double value, int digits)
Converts the given double to a string with the given number of significant digits.
toString
String toString(double value, int digits,boolean remove)
Converts the given double to a string with the given number of significant digits with trailing zeros removed if the Boolean remove is true. For example, 10.0000001 with number of digits set to 3 will return 10 rather than 10.000.
toString
String toString(double value, String format)
Converts the given double to a string using the given format specifier, which is the same as java.util.Formatter. See the corresponding Java format string documentation for more information.
toString
String[] toString(double[] darray)
Converts all the doubles in the given array to strings and returns a string array.
toString
String[][] toString(double[][] dmatrix)
Converts all the doubles in the given matrix to strings and returns a string matrix.
toString
String[] toString(int[] iarray)
Converts all the integers in the given array to strings and returns a string array.
toString
String[][] toString(int[][] imatrix)
Converts all the integers in the given matrix to strings and returns a string matrix.
toString
String[] toString(boolean[] barray)
Converts all the Booleans in the given array to strings and returns a string array.
toString
String[][] toString(boolean[][] bmatrix)
Converts all the Booleans in the given matrix to strings and returns a string matrix.