Advertisement

Results for "Category: String Manipulation"

ASP_Volume2 #35435
A 'Parse' function.

To split a string into pieces using a certain character as a delimiter. I do not want to get messages saying, "use the Split() function" as this isn't present in VB5. Example of this is "hello to you", with the delimiter as " ". You'll get back 3 variables, one containing "hello", one containing "to" and one containing "you"

ASP_Volume2 #35442
_Code Snippet for VB's Split() Function

This is a one line code snippet to extract any section of a string using the Split() function. You can actually return the indexed section right in the same line as the Split() without having to assign the Split() to an array.

ASP_Volume2 #35446
Convert UNIX files to DOS files and vice versa

This code converts UNIX files to DOS files and DOS files to UNIX files

ASP_Volume2 #35459
A Pig Latin Text Converter

This code does nothing more than take a word or phrase and convert it to Pig Latin. Now, it is not finished, as I need to somehow figure out how to take in account punctuation. It is almost there, tho, and any suggestions would be nice.

ASP_Volume2 #35496
AIML - Artificial Inteligence

Finally a little example of Artificial Intelligence in VB. This code was not developed by me, but i just want to share with you. I perceived that does not exist any example that uses natural language in the PSC, and focus on artificial intelligence in AIML. Therefore they use to advantage to use the ALICE and the TED, the two robots gifts in this example. Gratefulness special to the Dr. Wallace.

ASP_Volume2 #35589
English To French Translation Program

This program translates as you type. Right now I am mainly working on english to french but I have put limited support for french to english. I know that there are lots of sites that can do this for you but I made this so if someone was making a chat program people speaking two different languages could talk to each other. Please leave a comment so I know where to improve. I will try to upload a new version in a few days or so.

ASP_Volume2 #35633
English To French Translation Program(UPDATE!)

This program translates as you type. Right now I am mainly working on english to french but I have put limited support for french to english. I know that there are lots of sites that can do this for you but I made this so if someone was making a chat program people speaking two different languages could talk to each other. Please leave a comment so I know where to improve. I will try to upload a new version in a few days or so.

ASP_Volume2 #35666
convert/write a number in words

Takes any numerical value (less a billion) like "203463110" and outputs "Two Hundred Three Million Four Hundred Sixty Three Thousand One Hundred Ten"

ASP_Volume2 #35668
Extract HREFs (HTML Hyperlinks)

Extract hyperlinks from any HTML file. Create an output HTML file with options like sorting URLs, specifing colors, filtering links....

ASP_Volume2 #35683
RichText No API GoTo Line

This bas contains a function that sets the cursor position in a Rich Text box to a given line without using API. This is a very fast method - no, it doesn't just scan through and check every line - and works fine even with long RichTextBox texts!

ASP_Volume2 #35731
Generate a random string, with a length within a range.

This code will take a range (lower and upper), and output a string of random characters (0-9, A-Z, a-z). I use this to generate a key for encryption, during the key negotiation phase of a connection to an encrypted server. Usage is simple: Dim sKey as string sKey = GenerateKey(10,100) ' this code generates a key with a length between ' 10 and 100 characters.

ASP_Volume2 #35750
TypePad

Please leave comments. It helps me understand what people want or expect from a program like this. This is quite an advanced word processor. You can manipulate files, use the clipboard, print, print preview, setup page margins. You can also send documents as attachments through the email system, but you need the control, which is free, from Axsoft. Also, Microsoft Agent needs to be installed on your system. I have included the character here. Install it to c:\windows\msagent\chars folder. Once done, enjoy TypePad. If you have VCI VisualSpeller, you can also use this application to spell check. This program also can insert pictures from files, files, plus text files. To have the spell checker, a Borland product must be on your computer. Thank you for your interest.

ASP_Volume2 #35765
A Unlimited Undo and Redo featured RichText Editor

This code shows you how to create Unlimited Undo and Unlimited Redo, along with Cut Copy, Paste, and Select All features, in a RichTextBox Control.

ASP_Volume2 #35814
base64 decoder

Decode base64 encoded Input file into Output file.

ASP_Volume2 #35816
Get Info, String Length Known

' This easy code is design to open a text file, read a line at a time ' and take a set number of characters from the right hand side of each line ' This is a look at the basics of string and file manipulation ' I will also post a a program that will find a character and ' get the data left or right of it.

ASP_Volume2 #35826
basNamesAndDates

This is a .bas module that contains a few string manipulation functions I find useful in the real word. MakeProper replaces the limited proper case functions of VB with code that will format your string in title case, but not force mid-word capital letters to lower case. So "John Smith III" or "MacDonald" comes out correctly if typed are typed as "john smith III" or "macDonald". Initial letters of words are capitalized, but other letters are left as typed. DateWord takes a date and converts it to the phrasing used on legal documents, so 1/1/2000 would return "1st day of January, 2000." MailingLabelText accepts a number of inputs and returns a UDT that offers many variations on the name and address for use in creating mailing labels and other reports containing name and address data. The proper business ettiquette is observed in that the presence of an honorific like "Esquire or MD" eliminates the "Mr." or "Dr." Look for an update of this soon with more functions for string manipulation. The other functions are used by these three. LogError is pretty useful, too, come to think of it! I don't care about winning any prizes, I just wanted to contribute to a site that has helped me out so much. Your feedback is welcome all the same. PLEASE STILL RATE THIS SO I WILL KNOW WHAT YOU THINK!

ASP_Volume2 #35930
Number to Text Up to Billions with Bonus Uppercase (Updated)

That's right, all positive long values up to 2147483647. This simple algorithm can translate any positive long value to its string equivalent, both English and Spanish. The principle is simple: Process three digits at a time because the cycle is repetitive every three digits. The only thing you have to append every time is the order qualifier: Thousand, Million, or Billion. The code of the main function is commented, and the other functions are just plain very easy, so no commenting there. The user interface shown here is very simple because the object of this post is the functionality! :) BONUS: Included (and made just for fun) there is a custom uppercase function. It was programmed under the principle that switching between lower and upper case, all you have to do is flip bit &H20. It also writes to the source string directly by mapping an array to the string buffer (advanced stuff). I did not benchmark, but supposedly, this upper case method should be a lot faster than regular string manipulation, although I don't know if it is faster than the VB upper case function. If you want to implement this in one of your applications, all you have to do is drop the module in. Please vote and comment. UPDATE: Run-time error 9 in uppercase function solved. It was a silly error.

ASP_Volume2 #35964
Compare 2 Strings

This VERY short function compares 2 strings and returns a number (that can be converted into percentage if multiplied by 100) that represents how closely related 2 strings are. For instance "ABCDE" and "ABCDF" would return say.... .8 (80%). Great for suggesting fixes for spelling errors et cetera. Feel free to use, abuse, and manipulate the code however you want, I'm sure it's not original, but I know it can be helpful :).

ASP_Volume2 #36015
Add Colored Text to RichTextbox

Adds the text to a textbox, checking for length overflow. First, it checks, and if the textbox exceeds 15,000 characters, it strips out all but the last 2000 characters to make room for the new text. It doesn't break in the middle of lines - it only deletes 'whole lines.' Then it adds the text to the end, using the color you specified (if any), and scrolls to the end of the textbox. I use it all the time, got tired of cutting/pasting out of old projects, thought I'd put it here on PSC.

ASP_Volume2 #36024
All Chars

Very simple, almost useless code! Shows all "printable" ASCII characters. I needed this for something else, so I thought I'd post it here for beginners' benefit

Languages
Top Categories
Global Discovery