How to trim string till indexof the string

Ads
 

How to trim string till indexof the string

how to trim string till indexof the string

View Answers

March 4, 2011 at 11:08 AM

Hi there,
As you described your question, I guess this is what you need to do.

Please do try this

class TrimTill
{
 private void trimTillIndex(String str,int sIndex,int eIndex)
 {
  String output = str.substring(sIndex, eIndex);
  System.out.println(output);
 }
 public static void main(String\u005B\u005D args)
 {
  TrimTill tt = new TrimTill();
  tt.trimTillIndex("Hello There", 6, 11);
 }
}

Ads









Related Tutorials/Questions & Answers:
How to trim string till indexof the string
How to trim string till indexof the string  how to trim string till indexof the string
painless script trim string
painless script. The trim() method of String class is used for trimming the data
Advertisements
painless script trim string
painless script. The trim() method of String class is used for trimming the data
painless script trim string
painless script. The trim() method of String class is used for trimming the data
String indexOf(String str)
String indexOf(String str)     ... the indexOf(String str) method of String class. We are going to use indexOf(String str... about the indexOf(String str) method through the following java program
String indexOf() method in Java
String indexOf() method in Java In this tutorial we will discuss about indexOf() method in java. indexOf() method which is of string class,  used... for searching a specified character or string, indexOf() and lastIndex(). For example
String indexOf() Method
String indexOf() Method      ... the indexOf() method of String class. We are going to use indexOf() method of String... have taken a String. To find the index of any character we have applied indexOf
String indexOf(String str, int fromIndex)
String indexOf(String str, int fromIndex)   ... explanation about the indexOf(String str, int fromIndex) method of String class. We are going to use indexOf(String str, int fromIndex) method of String class in Java
String indexOf(int ch)
String indexOf(int ch)      ... the indexOf(int ch) method of String class. We are going to use indexOf(int ch... in a string we have applied indexOf() method and then we have passed a character
String indexOf(int ch, int fromIndex)
String indexOf(int ch, int fromIndex)   ... about the indexOf(int ch, int fromIndex) method of String class. We are going to use indexOf(int ch, int fromIndex) method of String class in Java
How to split string in Java?
How to split string in Java?  Hi, I have a string seperated by ',' comma. How to split the string? Thanks
Use of <fn:indexOf(String, String)> Tag of JSTL
Use of <fn:indexOf(String, String)> Tag of JSTL       In this section we will learn how to use... of specified sub string in the given string string. This takes string type
How to Append String In Java?
How to Append String In Java?  How to write program in in Java for appending to a String? How to Append String In Java? What is the best way to do this? Thanks   Hi, The best best to append to a string is to use
String
String  can u resolve anybody my problem is how to remove duplicate characters in string?   import java.util.*; class RemoveDuplicateCharatcersFromString { public static String removeDuplicates(String s
How to convert into to String in Java?
How to convert into to String in Java?  Hi, How to convert into to String in Java? Thanks
String
String  How to Convert sunnapu gopal to Sunnapu Gopal in java using String
String
String  how to print in between numbers if the question "String s = "1,2,3,4,5,6,8,-25"" out must be 1 2,3,4,5,6,7,8,9,10,upto25
STRING.....
STRING.....  plzz sent me d code for counting vowels in a string... gui programme
string
string  How to count a particular character in a given sentence and also displaying that contain word? Like I want to find "a" in the string... and a character. It then count the occurrence of that character in the string and display
string
string   difference detween "public static void main (String[] args) " and "public static void main (String args[])" in java but it executes both... "String args[]" can mean a "string array called args which is an array
string
string  String helloString = new String(helloArray); System.out.println(helloString); i am unable to understand this. could u plz explain
string
string  a java program using string function to input any string... ArrangeStringAlphabetically { public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.print("Enter string
How to append String in Java?
How to append String in Java?  Hi, I have a number of string in Java which is to be appended efficiently. How to append String in Java? Thanks... efficiently and then get final string. The append() of the class is used
how to print String as pattern ?
how to print String as pattern ?  i have a one String name ="rajesh" i want to print pattern like r * ra ** raj raje rajes rajesh please help me
Trim String Example
;} } Here is the video tutorial of "How to Trim String in Java...Trim String Example      ... spaces and shows only string.  Description of code: trim(): This method
String
String  write down the code of remove any character from a given string without using any string function   please give me the code of remove any given character from a given string without using function
How to display string or character
How to display string or character  how to print character or a word without using array concept
string
string  a java program to input a string and display the string...*; import java.io.*; public class FirstLetter{ public static String capitalizeFirstLetter( String str ) { final StringTokenizer st = new StringTokenizer( str
string
string   just i want to a program in a short form to the given string in buffered reader for example input string: Suresh Chandra Gupta output: S. C...; public class StringTest { public static void main(String [] args
How to convert String into java.util.Date
How to convert String into java.util.Date  Hi, How I can convert String date into java.util.Date in a Java program? Thanks   Hi... Getting time in Milliseconds Convert Date To Calendar How to convert String Date
How to convert a String to an int?
How to convert a String to an int?  I my program I am taking the input from user from a HTML form in JSP page. The value retrieved is in the String format. Now I want to convert into int value. Tell me How to convert a String

Ads