1. Getting substring forums.oracle.com |
2. help: why using substring forums.oracle.com |
3. Substring Loop - unsure how to do it. forums.oracle.comTo sum it up a bit more basic, I have to get the user to enter a String (using Scanner class), The string then has to be read back in a loop until the String entered has finished, for example if i entered Scott, it would have to output S:Sc:Sco:Scot:Scott, and each time the letters are read back they have to ... |
4. StringTokenizer and substring method forums.oracle.comwhile(hasMoreTokens) { src = nextToken; des = nextToken; cost = nextToken; String a = src + des + cost; } int [] [] array = new int[ i ] [ j ] Since I'm using tokens, I just want to take the cost and put it in a 2D array. Can I use the substring on a.substring (2,3) to get the ... |
5. multiple substring forums.oracle.comI don't think you need lastIndexOf. You need the indexOf that takes a starting point (otherwise, you always start at the beginning of the String). Then, after the first indexOf(" |
6. substring problem... forums.oracle.com |
7. how does the substring method work forums.oracle.comsplit public String[] split(String regex) Splits this string around matches of the given regular expression. This method works as if by invoking the two-argument split method with the given expression and a limit argument of zero. Trailing empty strings are therefore not included in the resulting array. The string "boo:and:foo", for example, yields the following results with these expressions: Regex Result ... |
8. while loop with substring() forums.oracle.com |
9. Substring function forums.oracle.comHello to all Guys i am trying to use Substring Function but not able to do it properly. I am having a String str="LITTEL BY LITTEL AN ACRON SAID"; The result which i want is that i should get each and every word and i cant use substrin(0,6) then substring(7,8) this i can't use i have to use a for loop ... |
10. better way to substring any text forums.oracle.comhi.. i have a txt file.which contain lot of data..in the following format i.e RTR0000001H0354 C000000000010000000000063A0000000000000{0000000000063A0000000000060{0000000000003A000000010000000000063A And i have to cut this string in tokens on basis of space(as delimeter) And then extract information from each token by applying substring.. As i know that by using StringTokenizer and subString() i can solve this issue.. But i want to know is it ... |
11. Should I use substring or tokenizer? Or something else entirely? forums.oracle.comI am a student writing a program that has to read a HTML file and make sure all the delimiters match. I tried substring to locate the indexOf the "<">" but for the whole string, it will only give me the first occurence of each one. My first string could be |
12. Explain the concept of substring forums.oracle.comI was about to post that I'd bet that even a computer illiterate newb would be able to work out what "substring" meant, then realised I had a real life one sat right here. I explained the concept of "strings" to my completely non-IT literate girlfriend, and asked her what she thought a substring might be. She was spot-on |
13. how does substring() method works ???? forums.oracle.comI'm trying to understand substring() method but doesn't seem to be getting close. The method substring(startIndex,endIndex); so i think in order to get "hell" from the string "hello" then i think i'd need to say substring(0,3) , m i right ?? But the result is not "hell" it's "hel" . I mean what's wrong with it ?? According to my understanding ... |
14. Substring problem. Unable to get the expected value using String.subString forums.oracle.comHi, I'm having a string whose value is " n" for example, String s = " n"; Now i want the string "\n" I used all the possibilities of s.subString (0,1) or (1,1) or (1,2) or (0,2) but i couldn't get the expected result "\n" Can anyone please advice how to get the expected result??? Thanks, Kathir |
15. .substring issues forums.oracle.com |
16. Java Substring forums.oracle.com |
17. Substring problem forums.oracle.comYou should write some tests to confirm that your code is correct. Try to think of lots of different inputs and make sure that the outputs are correct. You can use something like JUnit for this (it's a useful tool to learn) or just write your own if you're a newbie. Asking others to confirm that the code runs correctly is ... |
18. first string is a substring of the second one forums.oracle.comI need to write a User Defined Method which Checks if the first string is a substring of the second one. - Returns 0 if it is not a substring / 1 if it is / -1 if it is a circular substring this is an example of what it should do - abcde is a substring of blkjabcdelkjsd return ... |
19. Possible substring issue, need new eye's for my bug. forums.oracle.com |
20. source code for substring.. forums.oracle.comHi Experts, I have a requirement like this.. getting a purchase order in the variable PONUM as 00012345/abc i need to suppress all the zeros at the left side and when it reaches / then after the / terminate all the characters and return only the number, the output for the ponumber is 12345. eg: Input : 000123045/xyz Output : 123045 ... |
21. substring forums.oracle.comDear flounder, my program will read the file in and store in str. There is no split(delimiter) to determine when i should read new line. So in my case, I will need to split the string control by length. I tested the program after i posted this thread. Indeed the while loop will return false because the str length is larger ... |
22. Java substring.... forums.oracle.com |
23. hashtables: how can I get all the keys starting with a substring ? forums.oracle.com |
24. Regarding substring forums.oracle.comHi, I am currently using substring to extract part of a word and then compare it with a a predefine value. But when I perform a profiling on it, I notice the substring() is taking up a lot of my processing time. So, I am wondering is there another method that perform the same function as substring() but is faster. Or ... |
25. Substring? forums.oracle.comHi, I am currently working on a method that will loop through a list of words in a text file. There quite a large number of them. Each word in the text file once loaded, I will used substring to extract a portion of the word out which will be stored separately My question is there any method that will work ... |
26. Create Substring??? forums.oracle.com |
27. How to Substring from the last 3rd underscore? forums.oracle.comWell, you could use lastIndexOf three times (with the start position option) but I think it looks more like a job for a regular expression (which could also check if the file name has the pattern you're expecting.) You might want a pattern like "[A-Z][0-9]_{6}[A-Z0-9]*_[0-9]\.txt$", depends how much these file names are expected to vary. |
28. Help with substring - forums.oracle.comThis is what i have upto now and i get error message saying "out of bound". I would also like to credit Chris.Brown SPE for this code import java.util.regex.*; import java.io.*; class readlinebyline2 { public static void main(String args[]) { try{ FileInputStream fstream = new FileInputStream("c:/input.doc"); // Get the object of DataInputStream DataInputStream in = new DataInputStream(fstream); BufferedReader br = new ... |
29. Read/Find substring/ Write forums.oracle.com |
30. Substring Help forums.oracle.comHi , I would appreciate if somebody could help me with this. I have a text file with more than 4000 lines. I need to find a substring of 35 zeros '00000000000000000000000000000000000' and they could be in more than one place. This program should actually read from file to find those substring . If it find 35 zeros i need 10 ... |
31. how to print substring within a string without using StringTokenizer forums.oracle.com |
32. How to get a particular substring? forums.oracle.com |
33. Creating a Substring out of String seperated by comma forums.oracle.comHi, My requirement is that i have a String with comma seperated value. Say String str=''1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20..............."; In my SQL query I need the following. OR(str1) OR(str2); Where str1 is the first 999 strings from the String str. i.e str1="1,2,3,4................999" and str2="1000,1001.......................1999" How can i do this in java.Can anyone please help me out?? Regards, priya |
34. getting the substring forums.oracle.com |
35. substring generator forums.oracle.comI am tryung to build a program that will implement a substring generator. It will take a string and generate all substrings. Is this using permuate or what? For instance you take the word sun and some up with s su sun u un and n as substings Any assistance much appreciated Thanks Jonnie |
36. Substring or ...? forums.oracle.comHello, i have an interesting question :)) This is example of what i have to do.. From: kudazanovu@gmail.com Sent: Friday, December 28, 2007 9:45 PM To: kudazanovu@igorinjo.com Subject: [2008|cabaretrose] Brzo osvoji 28.12.2007. 20:44:54 Name: Ana Ivanovic Tel: 064/164-37-77 Email: anaaerobic777@yahoo.com Time: 28.12.2007. 20:44:54 From: kudazanovu@gmail.com Sent: Friday, December 28, 2007 9:04 PM To: ... |
37. String method to return subString based on "tags" forums.oracle.com |
38. How to get substring forums.oracle.comNo probs !!! you can comment on my approach. Basically, I would say it is kind of overkill. - First you check the format of the input String in order to determine whether your process will work. - Then, you split the input in order to extract the right-hand part of "ttl=". - Then you split this part in order to ... |
39. How can I make the substring stays at the same location after modified? forums.oracle.com |
40. how to make substring a string in concern with length forums.oracle.com |
41. Help, Substring not working, dont know why... forums.oracle.comI need to load some xml file and extract some data from it. I have this code. I thing that this have to work but havent...it prints input error... Any suggestion? file is opened by this code it works ///// if (e.getSource() == openButton) { int returnVal = fc.showOpenDialog(FileChooserDemo.this); if (returnVal == JFileChooser.APPROVE_OPTION) { file = fc.getSelectedFile(); //// /// this doesnt ... |
42. substring questions forums.oracle.com |
43. String.subString forums.oracle.comi heard that using subString method is String and StringBuffer are slow Where did you hear that? All it does (in sun's implementation) is create a new string object that references the same underlying char array as the original string with a different offset and count. This is done specifically for performance. would iterating the range and appending it to a ... |
44. I have a problem in substring forums.oracle.comI want to read from a file.The file contain strings like Cpu(s): 0.7% us, 0.7% sy, 0.0% ni, 98.3% id, 0.0% wa, 0.3% hi, 0.0% si I want to take the value 0.7 from the file. so I use substring(9,12) a pgm import java.io.*; class FileRead { public static void main(String args[]) { try{ // Open the file that is the ... |
45. Substring forums.oracle.comyes Olew Ur right but when we give the both index for substring (Start and End) then that is much better for getting substring from a string. yeah substring(beginindex) san give the right result in case of deepi Q,but if he/she want to get some substring which is not fisrt 4 or last 4 character then substring(stratindex ,endindex ) is used,thats ... |
46. adding color into substring forums.oracle.comI am trying to color suffix and prefix of strings. For example, I would like to change the suffix substring "tion" in the string "position" to blue or red. It seems like there will be straight forward way to do so, but I could not fine it. I tried doing it using the graphics functions, g.drawString, but then I could not ... |
47. substring a string in the reverse direction forums.oracle.com |
48. Wrong Answer for substring question? forums.oracle.comThis is the question from one of Sun's e-Practice exams. I am only posting it because I believe the answer is wrong. QUESTION: A text field in a GUI allows a user to type in a string, pNum, that represents a telephone number in the following format: AAA-PPP-NNNN; where A, P, and N are digits. Assume that this string format has ... |
49. Problem Related substring() function forums.oracle.comHi Friend, I wnat to use substring() function in my project. I have used it now for my work purpose but i am not satisfy with that. Actually i don't know how to use it when you don't know the length of the file name. Currently i know the file name so according to that i am putting substring function like ... |
50. Can i substring from the end ..? forums.oracle.comfor example i have 12345 i want to insert "1" and then i get 123 This makes no sense whatsoever. Please make an effort to communicate your problem more clearely From yor "substring from the end" subject line and the example your provided, I'm going to go WAAAAAYYYYY out on a limb and wild-a$$-guess that you want to provide a number ... |
51. How to remove a substring from a String? forums.oracle.comHi, I have a string with a lot of content and I want to remove certain parts. I want to remove all occurrences of "http://.....". Each http-adress end with a space, I mean theres a space separating the adress from the rest of the content (both before and after). Any help much appreciated! |
52. removing substring from string forums.oracle.comhi i have an XML in String format. need to remove schema from it. such as everything between |
53. Substring Method forums.oracle.comAs you can see from the code I want to use the variable Name as a string in the substring method. Can anyone tell me if this correct? Or can it be done? NP: I will be using a NamesTest.java to enter the text Joe so that notation = Joe and Name = notation. |