SubString help

Hi , I would appreciate if somebody could help me... a substring of 35 zeros '00000000000000000000000000000000000' and they could... substring . If it find 35 zeros i need 10 digits in front of it along with those 35

View Answers

April 23, 2008 at 8:19 PM

Hi friend,

import java.io.*;
import java.io.IOException;

public class FileReadExample {
public static void main(String args[]) throws IOException {
try{
BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Please enter file name");

String str = buff.readLine();
File file = new File(str);
FileInputStream fstream = new FileInputStream(file);
// Get the object of DataInputStream
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;

//Read File Line By Line
while ((strLine = br.readLine()) != null) {
// Print the content on the console
System.out.println(strLine);
String subString = str.substring(0);
System.out.println("String after index: " + subString);
subString = str.substring(1,2);
System.out.println("Substring (1,2): " + subString);
}
//Close the input stream
in.close();
}
catch (Exception e){//Catch exception if any
System.err.println("Error: " + e.getMessage());
}
}
}

--------------------------









Related Tutorials/Questions & Answers:
help with substring in c programing
help with substring in c programing  Hi I could not found programming.... Please help with substring function,prompt the user for two strings and display whether or not the second string is a substring of the first string. Regards
SubString help - Java Beginners
SubString help  Hi , I would appreciate if somebody could help me... a substring of 35 zeros '00000000000000000000000000000000000' and they could... substring . If it find 35 zeros i need 10 digits in front of it along with those
Advertisements
Substring in java
Substring in java   example:output 0f the code.. Input String:University of the Cordilleras Input Substring:of Output:1 ...use non static methods,don't use (.Substring).. ..please help me.. ..thank you.. deadline:November
Substring in java
Substring in java   example:output 0f the code.. Input String:University of the Cordilleras Input Substring:of Output:1 ...use non static methods,don't use (.Substring).. ..please help me.. ..thank you.. deadline:November
find and substring
find and substring   **import java.io.BufferedReader; import... String"); String findstring = keybord.readLine(); String substring = keybord.readLine(); findreplace(findstring,substring); } catch(IOException io
C Programming SubString Program
C Programming SubString Program  Sir I want to Check whether the Single Substring is present in the given 3 string. characters. eg if i entered... will be TRUE. Plz Help Me
ModuleNotFoundError: No module named 'substring'
ModuleNotFoundError: No module named 'substring'  Hi, My Python... 'substring' How to remove the ModuleNotFoundError: No module named 'substring' error? Thanks   Hi, In your python environment you
How to substring in Java?
How to substring in Java?  Hi, I want to get a part of String in Java. How to substring in Java? Thanks   HI, Hi you can use the substring() method of Java for getting a part of string based on the index number
Java Substring
Java Substring In this section we will read about Java Substring. A part of String is called substring. Substrings are also a String. Substring is used..., how they can find the substring. To find the substring in Java there is method
How to substring in JQuery?
How to substring in JQuery?  Hi, I my JQuery application I am getting the value from server using Ajax. I have to substring the value in jQuery.... Please let's know How to substring in JQuery? Thanks   Hi
JavaScript substring length
JavaScript substring length...; This section illustrates you how to determine the length of substring in JavaScript. You... method substring() in order to extract the substring from  the defined
remove a substring from a string
remove a substring from a string  Please I jave an arraylist composed as follwoing [w1, w2, w3, w4, w1.w2.w3, w2.w3.w4, w3.w4, w2.w4, w1.w3, w1.w2] w2.w4 is a subset of w2.w3.w4 ?how I recognize it also ADS_TO_REPLACE_1 w1.w3
check if a substring exists in a string
check if a substring exists in a string  Please I jave an arraylist composed as follwoing [w1, w2, w3, w4, w1.w2.w3, w2.w3.w4, w3.w4, w2.w4, w1.w3, w1.w2] w2.w4 is a subset of w2.w3.w4 ?how I recognize it also ADS
JavaScript indexOf substring
JavaScript indexOf substring...; In this section, we are going to find the location of substring using... the parameters substring is the specified string and 0 is the index
Search string using substring
Search string using substring  I want to print a string by searching a substring of that string. - i want to print email-ids from word files (resumes) in a directory. Search can be made using @ in the word file. So far i can
help
help   how i can send a pitcture on url in java
help
help  pls help me to get the code of a java program a program to perform different shapes in a menu using javaapplet
help
help  i need help with this code. write a java code for a method named addSevenToKthElement that takes an integer array, and an integer k as its arguments and returns the kth element plus 7. any help would be greatly
HELP
HELP  I need this code to open in a new web browser. but no matter what i do it wont please help?? Directive 055 Storage Requirements for the Upstream Petroleum Industry
Help...
Help...  Write a class that displays your first name vertically down the screen â?? where each letter uses up to 5 rows by 5 columns of a character input by you with a blank line between each letter
Help
Help   i have a html file.. i have take input and store in database .. Tell me the steps to perform.. i have xampp it includes mysql,tomacat,apache. and how display the data from datbase .. please explain
Help!
Help!  thanks for ur code, I'd like to ask a question: after press "c" or "C", timer starts and after every delay ms, it'll print "This line is printed only once." or just print once. I'm writting a timer but it seems to perform
help
verification mail to the user) please tell me how could i design that. Please help me
Help
Help  Hi; Can anyone help me to solve this errors. I use J2ME(wirlesee Toolkit 2.5.2. for CLDC Project "SlideImageMIDlet" loaded Project settings saved Building "SlideImageMIDlet" C:\Documents and Settings\???? ?????\j2mewtk
SubString in Java
SubString(), a method of String class is used to get a part of original string.... This method has two types: SubString(int beginIndex): This method returns part.... If beginIndex is equal to length in SubString(int beginIndex) it will return empty
help
based on the percentage of cheating. please help me
help!!!!!!!!!!!!!!!!!!
help!!!!!!!!!!!!!!!!!!  import java.awt.; import java.sql.*; import javax.swing.*; import java.awt.event.* public class NewJFrame extends javax.swing.JFrame { JTextField1
String substring method example
.style1 { font-size: medium; } String substring() method example:- In the Action Script3, substring are sequential characters that are found from a string. String class provide methods for finding substring from string. Method
C String Substring
C String Substring       In this section, you will learn how to get the substring from a string in C. You can see in the given example, a string and a method substring
JPA Substring() Function
JPA Substring() Function       In this section, you will learn about the JPQL substring() function. The substring() function returns the some part of string arguments
String substring(int beginIndex)
String substring(int beginIndex)   ... the substring(int beginIndex) method of String class. We are going to use substring(int beginIndex) method of String class in Java. The description of the code
find a substring by using I/O package
find a substring by using I/O package  Write a java program to find a sub string from given string by using I/O package
How to check if a string contains a substring in iOS?
Function for checking the presence of a substring in a string (NSString... the presence of substring in a string (NSString) and there is no readymade function... of a substring in a string. This function will simply tell you if NSString object
C get Substring from String
C get Substring from String       This section illustrates you how to get the substring using library function. You can see in the given example, we have used the library
Regular Expression Help Help HELP!!!!
Regular Expression Help Help HELP!!!!  HI all I am very new to java... could help me to give a solution of how to retrieve the name and email add... the quotes ""07001", "MR Harish Ram","M.RHarish @ hotmail.com"" Help is greatly
String substring(int beginIndex, int endIndex)
String substring(int beginIndex, int endIndex)  ... explanation about the substring(int beginIndex, int endIndex) method of String class. We are going to use substring(int beginIndex, int endIndex) method of String
Use of <fn:subString(String, int, int)> Tag of JSTL
Use of <fn:subString(String, int, int)> Tag of JSTL... substring(java.lang.String, int, int)      ADS_TO_REPLACE_2     subString_fnJstlTag.jspADS_TO_REPLACE_3 <
write a java program for inserting a substring in to the given main string from a given position
write a java program for inserting a substring in to the given main string from a given position  write a java program for inserting a substring in to the given main string from a given position
Help me
Help me  Hi, LWUIT is working in eclipse j2me for Symbian OS
Taking Substring
are creating a new sub string with the help of substring() function of String class... Taking  Substring      ... string. You will learn how to use the substring() method of String class
help me
help me  HI. Please help me for doing project. i want to send control from one jsp page to 2 jsp pages... is it possible? if possible how to do
help me
help me  how to print from a-z, A-Z with exact order using for loop? Thanks for all concern
Help Me
Help Me  What is the source code for Sample example for Mortgage Calculator in J2ME language for developing Symbian