A String Of 5 Million Characters To Be Substringed?
Jun 2, 2012
I'm creating a book reader, and the book is about 5 million characters. This book contains a lot of chapters, and what my program does is that if I asked for Chapter 2, it would go to the first index of where it says (Chapter 2), and it would delete everything behind it using substring(0, indexof(Chapter 2)). And everything after the Chapter.
I've written the code which is about 4 lines not anything more. The original text file book is in the resources. I've set a string = the resource. I tried then searching for Chapter 1, it worked. It worked until about Chapter 7, then it stopped working for the all the Chapters after it.
I thought that Substring cannot search into that huge number of characters. So i cut down the book into another part from Chapter 7 to Chapter something, and like that. And it was of 8 parts at last. Set each one as a resource and set a string = resource. It would search in the first part, to the last part until it finds it.
However, I noticed later that when I tried searching for Chapters 5 or 6, it stopped working! Chapter 7 is working. The last chapters in each part are not working anymore.All I could think of that it is a memory problem, not a substring problem. What can I do?
View 3 Replies
ADVERTISEMENT
May 3, 2012
I have a string of characters, but I would like to have a string of hexdecimal characters where the hexadecimal characters are converted by turning the original characters into integers and then those integers into hexadecimal characters. How do I do that?
View 3 Replies
Sep 13, 2010
i have been trying to remove special characters. i am not able to remove many crlf in middile of the string.
View 3 Replies
Aug 3, 2009
I need to create a console program that allows you to enter a string, of which is then outputted in reverse.
Sample:
Input: Diewas
Output: saweiD
Apparently I need to find out about strings and will also need to use a loop.
View 9 Replies
Feb 23, 2011
Not sure if too many people know this, but the following line will cause an error:
GroupName.Substring(0, 3) = "jt_"
....if the length of GroupName is less than 3 characters. I always thought it would simply return whatever characters in GroupName, but no, it errors. I must be thinking of the old VB6 days.So, I now have to change the code to:
If (GroupName.Length > 2) Then
If (GroupName.Substring(0, 3) = "jt_") Then
Note that the two comparisons need to be on separate lines. If they are on the same line, such as:
If (GroupName.Length > 2) and (GroupName.Substring(0, 3) = "jt_") Then then the code will still fail as the length command is executed at the same time as the substring command- which will cause the error when the GroupName length is less than 3.Just thought that those of us not aware of this should be!
dp.SyntaxHighlighter.ClipboardSwf = '/dp.SyntaxHighlighter/Scripts/clipboard.swf'
dp.SyntaxHighlighter.HighlightAll('9844f9bfb55449e6a786fa62aaadfa20')
dp.SyntaxHighlighter.HighlightAll('f6d554fd98464bdba9159b319e51b381')
dp.SyntaxHighlighter.HighlightAll('93bf4ca63ad8447abdf084d8a9991e15')
View 8 Replies
Jul 19, 2011
I need a query that would allow me to find/search same STK_HOLD_NAME and/or STK_HOLD_CODE in my record/database . I dont how to query it because my table_STK has a million of records.
Im using MS SQL SERVER 2008 R2.
View 3 Replies
Aug 17, 2011
[URL]
Each set of ( 1 million ) prime numbers is in a ZIP file just click on say 1st Million
on the left to download a list as a ZIP file.
Here is a similar page which is a lot easier on the eyes:>>
[URL]
These are of course great to use in any security application or as part of any password.
However with the list so readily available on the internet is it such a good idea to use a prime number as part of a password? Food for thought perhaps? ....
I guess it depends on how long it is too. :-)
You could try to remember one that is close to an important date or other number that you know maybe?
If you are more paranoid use more than one prime number in a password with other characters ( UPPER and lower case letters etc ).
[URL]
View 1 Replies
Jun 27, 2010
I salvaged the following piece of code from:[URL]...This code works fine, but the problem comes when I need to get all the primes above 100 million. I am familar (at least a little bit) with the BigInteger class in .NET 4.0, but when I replace all the instances of "Integer" with "BigInteger" in the following code I get this error: Value of type 'System.Collections.Generic.List(Of System.Numerics.BigInteger)' cannot be converted to 'System.Collections.Generic.List(Of Integer)'.
(The reason I need primes above 100 million is that I'm trying to work through some projects on www.projecteuler.net)Anyone have some ideas on how to modify the code to work with BigIntegers,
[Code]...
View 2 Replies
May 5, 2012
I have written a program that uses an array of the english alphabet and Morse code. I also built a form with a input box for the alphabetic information and an output box with the Morse Code. What i am trying to do is basically type a word like "Hi" in the input box and produce the Morse Code equivalent in the Morse Code output box. [Code] This works but only one letter at a time. Do i need to Parse the string of characters one at a time, and then run it through a loop like i have created?
View 6 Replies
Aug 17, 2009
I've written an algorithm that I believe to be correct for computing prime numbers up to n with the Sieve of Eratosthenes. Unfortunately, this program hangs on really large values of n (try 10 million). Here is what I've written...
Protected Function Eratosthenes(ByVal n As Integer) As String
Dim maxValue As Integer = Math.Sqrt(n)
Dim values As Generic.List(Of Integer) = New Generic.List(Of Integer)
[code]...
How might I speed this algorithm up? Where are my bottlenecks?
View 12 Replies
Jun 30, 2009
I have a string like 0010000.abc. Is it possible to print just the first 3 characters of the string i.e 001?ajaind
View 1 Replies
Sep 23, 2011
I.E. replace "http:adf.ly/random"to "adf DOT ly /random"..Removes http: and changes . to DOT and adds spaces.
View 3 Replies
Jan 19, 2010
I am trying to manipulate a string to get to a part of the string inside 2 specified characters. Getting anything inside the > and the space. string starting with: jk;fhdididlsls/"f>Dog (467838) fgdad
I am trying to get "Dog" out of this.
dim x as string
dim y as string
x="jk;fhdididlsls/"f>Dog (467838) fgdad"
y = x.Split(">" , " ")
MsgBox(y.Join(""))
It will somehow always error out: value of 1-dimension array of string cannot be converted to string
View 1 Replies
Nov 14, 2011
I have a barcode that once scanned returns a string 8 characters long.
Further along the program I have this line of [code]...
View 1 Replies
Mar 14, 2009
I want to be able to get the first x characters of a string
View 2 Replies
Jun 27, 2011
I have a string like this:
1a2b3c4d5e6f7g8h
And I need to rearrange it as follow:
a1b2c3d4e5f6g7h8
Do you understand what I mean? For each two characters, the numerical character swapping place with the following letter, i.e. from 1a change it to a1.how to rearrange the numerical characters and letters in the string? My string always has the said pattern, i.e. one integer then followed by a letter then followed by a integer then followed by a letter and so on.
View 2 Replies
Nov 19, 2011
How can I add space after every 4 characters to string that returned from a function? I know the returned value it is 8 or 12 or ...etc.
for example function myString will return the value of ABCDEF12XY1Z
How can i display in textbox1 as ABCD EF12 XY1Z
View 7 Replies
Apr 2, 2010
I have a string value (which is a hex value) that is displayed as so...F8 30 00 3D FC 13 F8 30 00 01 31 73 34 FE 34 DE F8 30 00 3D FC 13 F8 30 00 01 31 73 34 FE 34 DE F8 30 00 3D FC 13 F8 30 00 01 31 73 34 FE 34 DEThis continues on in this exact pattern. What I am trying to do is to get a " " inserted after the first 24 characters, and then after the next 24, delete a character and place an Enter or Return value. Then I would like another " " after the next 24, and then after 24 more, delete a character and place an Enter or Return value so on until the end of the string. The format would then look like this.[code]I know this is probably done with some type of array and loop, but I'm not even sure where to get started.
View 8 Replies
Aug 3, 2010
I've got a program that in a nutshell reads values from a SQL database and writes them to a tab-delimited text file.The issue is that some of the values in the database have special characters (TM, dash, ellipsis, etc.) When written to the text file, the formatting is lost and they come across as junk "â„¢ or â€" etc"
When the value is viewed in the immediate window, before it is written to the txt file, everything looks fine. My guess is that this is an issue of encoding. But, I'm not real sure how to proceed, where to look, or what to look for.Is this ASCII or UTF-8? If it's one of those how do I correct it before it's written to the text file.Here's how I build the text file (where feedStr is a StringBuilder)
objReader = New StreamWriter(filePath)
objReader.Write(feedStr)
objReader.Close()
View 1 Replies
Mar 4, 2009
character manipulation in a String.
How do you change characters in a particular string and set them to a particular value.
For eg. I want to change the third character of the string "hello" to Y = > i get "heYlo".
I tried using the Chars function but it says that the function is read only.
View 4 Replies
May 17, 2011
I am just a beginner in VB programming. What if I want to check if a certain subtext is present in a string? For example, what do I code if I want to check if the word "hello" is present in a particular string or not?
View 3 Replies
Sep 22, 2010
I am in a rather silly situation...suppose I have a text box in which I enter a line of text/characters/numbers...how would I be able to display the last two or first two (or may be middle two?) characters into another text box.
Example: I write "Hello World!" in the first text box and the program should display the first two characters from that text box, i.e. "he".
View 5 Replies
Feb 4, 2011
Ok, so I have a string called item. It's value is "Coffe`". When I try to get the number of caractors by using:
textcount = item.length
However it returns with the value "5". even though there is 6 caracters.
View 6 Replies
Sep 16, 2008
I need to return everything between the 2 dashes:
"xxx-12345-xxx"
Here's my conditions:
Sometimes the middle part may contain more than 5 characters, so it could look like this: "xxx-12345AB-xxx" Sometimes there's no second dash, so a string could look like this: "xxx-12345"
View 13 Replies
Mar 28, 2011
how I would find certain characters in a string.
View 4 Replies
Jan 30, 2010
I have a query to solve for which I have coded. But my code produces output only for those hardcoded values found in the text file. I have a text file which is given as the input to my code. The text file contains lines with "_DIA" , "_DIA_some number" etc. In this case I need to remove few letters from that field.
Eg: 1)if the name field contains 1234567_DIA_2.PRT, I need to remove "_DIA_2" from the name field and concatenate the .PRT with the number. 2)if the name field contains 1234567_DIA1.PRT, then remove "_DIA1" and concatenate. I need to store the number of characters removed and add so many number of blank spaces with the name field after the concatenation.
for the 1) case I need to concatenate and add 6 spaces with the name field. for the 2) case I need to concatenate and add 5 spaces with the name field.
I'm not sure how to find the number of characters from "_" to ".", underscore need to be considered in the counting and the dot(.) should not be taken into account.
View 2 Replies
Oct 18, 2011
Ok I am on the last part of this part of my project... If I have a strings like[code]...
I am having to parse address information out of a file... The parser works fine for addresses that do not contain a CR which means County Road. So I am thinking I can strip the address part out of the string I am passing into the parser by using something like.[code]...
View 1 Replies
Jun 21, 2010
I want to just get the leftmost characters from a string. Something that should be very simple...and yet!
Here is an example:
Code:
Dim strA As String = Now.ToString
strA = Strings.Left(strA, Len(strA - 1))
Why does this return an error: "Conversion from string to double is not valid."
View 3 Replies
Nov 30, 2010
I don't think you understood the title, but this is what I mean: If a path string is "C:UsersUserNameImages2010NovemberMyDogMondayDog1.png" for example... How could you like cut it to 30 characters: "C:UsersUserName...Dog1.png".
View 6 Replies
Nov 20, 2010
Say I open a text file in a richtextbox control. After that I search for a specific string like "6.1". The string actually continues like "6.1XXXXXXX". I need to get not just only "6.1", but also 2 more chars after "6.1", like "6.1XX". I will then output this in a textbox, but I can do that, I don't know how to get the X number of characters.
View 4 Replies