Answers for "getting part of a string java"

1

extract one string java

int pos = 0; //Arbitrary position, can be any number
"String".substring(pos, pos+1);
Posted by: Guest on December-06-2020
9

how to substring in java

class scratch{
    public static void main(String[] args) {
        String hey = "Hello World";
        System.out.println( hey.substring(0, 5) );
        // prints Hello;
    }
}
Posted by: Guest on January-08-2020

Code answers related to "getting part of a string java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language