Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

de caracter a string en java

//String a Entero
Integer entero = Integer.valueOf(cadena);
// o
int entero = Integer.parseInt(cadena);


//Integer a String
String cadena = Integer.toString(entero);
// o
String cadena = String.valueOf(entero);


//Char a String
String cadena = Character.toString(char);


//String a Char 
char caracter = cadena.charAt(0); //Solo primer caracter


//String a Double
double doble = Double.parseDouble(cadena);


//Double a String
String cadena = String.valueOf(doble);


//String a Float

float flotante = Float.parseFloat(cadena);


//Float a String

String cadena = Float.toString(flotante);


//String a Boolean

Boolean boolean = Boolean.valueOf(cadena);
// o
boolean boolean = Boolean.parseBoolean(cadena);


//Boolean a String

String cadena = String.valueOf(b);
// o
String cadena = Boolean.toString(b);
Comment

como apanhar caracter de uma string em java

String text = "Hello World!";
//To get the first charecter from a String
String a = text.substring(0, 1);
Comment

PREVIOUS NEXT
Code Example
Java :: encapsulation java 
Java :: look and feel java 
Java :: maths trivia in java 
Java :: java printwriter create file 
Java :: capture console output java 
Java :: int conversion to float 
Java :: how to add element to dictionary 
Java :: data structures in java 
Java :: super class tostring java 
Java :: set up a tree in java 
Java :: switch statement in java 
Java :: Java Create a BufferedReader 
Java :: java design patterns 
Java :: enhanced for loop java 
Java :: declaring java variables 
Java :: add items to linked list java 
Java :: sum of array in java 
Java :: how to encrypt password in properties file in spring boot 
Java :: spring mongodb 
Java :: java code to get all leaf nodes of a xml 
Java :: @Async how it works @EnableAsync 
Java :: md5 java ee 
Java :: session management in java spring boot for login logut 
Java :: convert kotlin code to java 
Java :: input method manager hide keyboard 
Java :: What is the use of @Listener annotation in TestNG? 
Java :: guava-18.0.jar 
Java :: Iterating The Queue Elements 
Java :: mysqld always running 
Java :: acceder a elementos de list java 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =