Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Example on: Getting the substring after the first occurrence of a separator in Java

public class Demo {
   public static void main(String[] args) {
      String str = "Tom-Hanks";
      String separator ="-";
      int sepPos = str.indexOf(separator);
      if (sepPos == -1) {
         System.out.println("");
      }
      System.out.println("Substring after separator = "+str.substring(sepPos +       separator.length()));
   }
}
Comment

PREVIOUS NEXT
Code Example
Java :: bouble to bytes[] java 
Java :: events that people think are unlikely but actually have high probability 
Java :: convert string to char array in java 
Java :: execute application jar 
Java :: Unable to locate a Java Runtime that supports apt. 
Java :: java replace all space with underscore 
Java :: java kommentointi 
Java :: pyramid star pattern in java 
Java :: bungeecord plugin add configs 
Java :: Integrity check failed: java.security.NoSuchAlgorithmException: Algorithm HmacPBESHA256 not available jks 
Java :: how to change orientation of linearlayout in recyclerview android 
Java :: file to multipartfile in java 
Java :: youTubeInitializationResult gives SERVICE_MISSING error in android 
Java :: volley library dependency 
Java :: android java date from internet 
Java :: java repeat loop cycle for 
Java :: java transform hashmap to list 
Java :: java test file exist 
Java :: how to compare 3 numbers in java 
Java :: how to add image in title bar in android 
Java :: how to set landscape in android studio 
Java :: spinner get item text 
Java :: how to find power of a number in java 
Java :: gradle require java version 
Java :: last day of month from localdate java 
Java :: string to long java 
Java :: how to make a char uppercase in java 
Java :: round off java 2 decimal places 
Java :: Private properties in JavaScript ES6 classes 
Java :: localdate add months in java 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =