Results for "Category: String Manipulation"
Encode/Decode a string. (BMTEncode refined version). If f.ex. enter AA the 2 output chars wont be the same.
format a text field into a $ currency field.
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
I was just poking around this site, and noticed that a lot of folks were making the copy/paste/cut/undo functions more difficult then they really needs to be. Rather then writing your own functions, make use of the SendMessage API and let Windows do the work for you.
This demo shows some of the capabilities of editing RichTextBox tags to achieve very fast global formatting. Great for Syntax Highlighting etc.
A FAST and EASY way to count the number of occurrences of one string within another! Please vote for this tip if you find it useful.
The original source code was from someone (AndrComm or Sebastien?) else. I recode the whole thing, but having reference to the original. Anyway thanks, whoever who are who wrote the original code (yeahh.. all creadits to him) since i learnt some performance optimization (my original codes are tremendously slow).I did some code clean up and comments. The encode speed increased by 20%, decoded speed increased by 30%. Here's the best results that i come out with: file : command.com (93,040 bytes) load : 2.56 mb/sec (n/a in original code) save : 3.39 mb/sec (n/a in original code) encode : 7.17 mb/sec (20% faster, original code runs at 6.05 mb/sec) decode : 7.31 mb/sec (30% faster, original code runs at 5.61 mb/sec) Here's the changes I've made : 1. *REWROTE* code clean up (i think it should be more readable) 2. *REWROTE* encode and decode table is created together. 3. *REWROTE* sub DECODE rewrote (should be faster). 4. *REWROTE* sub SPAN and UNSPAN now supports SpanSeparator. 5. *ADDED* More detailed co1mments for novice, not experts 6. *ADDED* some form controls, for input and output. 7. *ADDED* file loading and saving feature 8. *FIXED* encode / decode rate calculation fixed... more accurate should be 1 sec = 1024 ticks (kernel 1044 ticks?) and 1 mb = 1048576 bytes. (1024b x 1024b) and some other minor corrections as well...
4 functions to handle command line options...example: yourprogy.exe -F, etc...one of them checks if a commandline option is in the command line....another one creates a commandline set with options...another one removes a specified option from the command line, and return the cmdline...(example: sometext -F, to sometext)...and the last one pulls out the text between 2 options in the commandline, and returns it...so -S blah -E would return just "blah"..can be very usefull...
This program encrypt or decrypt a text, with a key and a checksum checker. Very good program
Encrypts and decrypts strings
Get the statistics of your code. Find out exactly how many lines it is. It is easy to modify this project to include other file types etc.
Formats SQL strings with quotes and line breaks for use in VB. This was a project that was submitted by another user that I have modified. I have added in the ability to update which SQL clauses will cause a line break, using a txt file. Also I have updated the SQLVarPos so that it uses an array for position location of key words. This also has better tab order and an auto-tab so you are ready to copy your formatted string as soon as you select "Format String".
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.
DUHH
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.
I use ExtractArgument (written by my friend Mike Carper) all the time. It returns an argument or token from a string based on its position within another string and a delimiter. For example: I want the "2" in the following string: "1,2,3,4,5,6,7,8,9,10". 'Sample call 'Dim sList as string 'Dim sTown as string 'sList = "POB 145,Dexter Street,Anytown,USA" 'sTown = ExtractArgument(3, sList, ",") 'sTown will be "Anytown" I find this very useful in working with delimited files and strings, and have implemented it in INI settings as well.
' Given an editable textbox named Text1, this code prompts to find a word and ' searches throught the textbox and highlights the first occurance of the ' found word (if exists).
This following function takes an HTML page and strips it of all tags.
If an alphanumeric string is provided in the form 123,33,44,556 , my function seperates the numbers seperated by any character in this case a (,)comma so we get num1=123 , num2 = 33 , num3=44 and so on.The function uses an array to store these numbers.DO mail me on how well this code works.
'This function can be implemented anywhere to finish off a word in a textbox using a list of words with a custom delimeter. It is fairly complex and difficult to document, so bare with me. It also uses the amazing extract argument function written by another code of the day submitter. I have spent lots of time fine tuning this code and making it as flexible and foolproof as the one used in Internet Explorer 4.0.