Results for "Category: String Manipulation"
Compresses strings, most effective on bitmap files
This short and sweet function accepts a string containing text to be spell checked, checks the text for spelling using MS Word automation, and then returns the processed text as a string. The familiar MS Word spelling dialog will allow the user to perform actions such as selecting from suggested spellings, ignore, adding the word to a customized dictionary, etc.
This is a class module that performs regular expression searches in a string.
Want to sort 5,000 10-byte strings in about 1/10th of a second? This will do it (at least on my PII-233!). The insertion sort manages the same task in about 60 seconds (even when optimized it still took about 15 seconds on the same machine).
This routine was designed to act as a numbers-only mask for any TextBox Keypress event. Simply call it from any KeyPress event and feed it the KeyAscii return value.
This code duplicates the functionality of VB6's split function.
RECURSIVE DESCENT PARSER FOR NUMERIC EXPRESSIONS
Converts a name or word string to a four digit code following Soundex rules. Similar code is used by geniological groups and the US Census Bureau for looking up names by phonetic sound. For example, the name Darrell can be spelled many different ways. Regardles of how you spell it, (Daryl, Derrel, Darel, etc.) the Soundex code is always D640. Therefore, you assign a field in your database to the Soundex code and then query the database using the code, all instances of Darrell regarless of spelling will be returned. Refer to the code comment section for more information.
This is a recursive function that evaluates strings expressions. It supports multiple levels of parenthesis, algebraic evaluation of expressions (in this example exponentiation ^ has same level of multiplication and division), function calls, logical operators, string/date/numeric functions and expresion evaluation. This is the base for the creation of a scripting language.
Convert a string in EBCDIC format downloaded from an IBM mainframe to ASCII format.
Convert ASCII strings into EBCDIC code to upload into an IBM mainframe. This code may be used also as a basic encrypting method. Both ASCII to EBCDIC and EBCDIC to ASCII are included in this code.
format a text field into a $ currency field.
This example I put together teaches you how to use the InStr function with a string. InStr is very important to use because you can get certain information from a String by using it. Example: say a String has your first and last name in it like "Mike Canejo". InStr allows you to get just the last name or first name. First and Last name are just an example. You could do tons of things with Instr. This is very important for a beginner to know trust me. You'll be surprized if you end up using it in your next vb project :)
This code recieves RTF code as output by a Rich Text Box in VB or MS Word. It outputs the equivalent in HTML. It's in a somewhat BETA form in that it handles a number of but not all of the possible codes. If you encounter a code it doesn't properly convert just send it to me and I'll try to fix the function within 24 hours. I think it does a better job on uncomplicated text than MS Word's HTML conversion.
Visual Basic 6 has a new function called InStrRev, which searches a string from right to left. I found it very usefeul, so much so that a project of mine relies completely on it. When I tried to work on the project at another location on VB5 I found that the function did not exist. So, I wrote it. I left out the compare method, you can add it if you want
This shows you how to search for a "string" inside of a "string" to see if it's there or not. This makes a good E-mail validator.. If the user doesn't put the "@" character, this will know it's not there and return false. This also works the same way if your trying to validate a Full Name. I commented everyline so enjoy and good luck.-Mike
This Function Adds quotes to a filename... especially useful when sending an arguement to a program (ie a filename) and it has spaces in it (with spaces if shows up as multiple arguements.
This code is a direct replacement for the VB6 Replace function. Obviously, VB 6 users will have very little (if any) use for the function. It is intended for use with older versions of VB that do not have the in-built Replace function. I noticed a similar piece of code released earlier this week, but it only appeared to handle character replacing and not strings. This version will do both and it's pretty tight and fast.
This code convert a TXT file to EXE file.When you convert the file start the EXE and the old file will be typed(like TYPE command) This is really great code NOTE : RUN THE .EXE FROM MS-DOS MODE
I was recieving several requests after recently making a post concerning a scrolling credits examples, simply saying that I had something similiar that worked in most aspects slightly better, because it used BitBlt and read the credits directly from a text file. I got quite a few emails requesting I send them it, so I just decided to post it to this site. Hope everyone likes it, if not sorry.