Advertisement

Results for "Category: String Manipulation"

5_2007-2008 #172203
Quick tip on how to handle NULL in ADO.net

If you're an old ADO programmer, you may be frustrated by not knowing exactly how to check for NULL. Here's a 1 second tip on how to do it in ADO.NET.

5_2007-2008 #172230
Extract Numerical Values from Text Strings

The purpose of this routine is to take a string of text (such as with a textbox) and extract a numerical value from it. let's say that you have a textbox in which people enter dollar amounts. Many users are likely to enter something such as "$ 4,335.49" and expect calculations to be performed on it. The trouble is, the value of that string is 0 (zero), not 4335.49!

5_2007-2008 #172284
Compression, uncompression using RLE-algorithm

Compresses strings, most effective on bitmap files

5_2007-2008 #172297
MsSpellCheck( string ) : string

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.

5_2007-2008 #172302
RegularExpression

This is a class module that performs regular expression searches in a string.

5_2007-2008 #172315
qsort

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).

5_2007-2008 #172317
IsNumber

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.

5_2007-2008 #172333
VB6 Split Function in VB5

This code duplicates the functionality of VB6's split function.

5_2007-2008 #172334
img2db

upload image(jpg) create thumbnail and store both in a database. Also can view images in database

5_2007-2008 #172335
FormatFileSize

FormatFileSize: Formats a file's size in bytes into X GB or X MB or X KB or X bytes depending on size (a la Win9x Properties tab) * UPDATED Sept. 12, 2000 * to allow for overriding the default Format Mask.

5_2007-2008 #172339
Trim non alphanumeric characters FAST

It will erase any non-alphanumeric characters from a string rapidly. Usefull if you want to check strings for non-valid characters. Strings such as email or web addresses, you can even make so that only numbers can be entered in, for example, a text box.

5_2007-2008 #172353
Change order of letters in a word

This code is just for fun, it demostrates an interesting phenomenon and some ways to manipulate strings, and arrays. According to research at an English university, it doesn't matter in which order the letters in a word are, the only important thing is that the first and last letters are in the right place. The rest can be a total mess and you can still read it without a problem. This is because we do not read every letter by itself but the word as a whole. This works with nearly every language. IMPORTANT: A similar program was posted a little before mine, but I posted mine without knowledge of that, and without seeing any portion of the code. This program (and I'm sure the other one too) was inspired in an email that got forwarded around the world a few days ago. The main difference between my program and the other one is that this one uses a byte array and totally randomizes the order of the words, the other program merely reverses the order of the letters. Thank you.

5_2007-2008 #172362
RECURSIVE DESCENT PARSER FOR NUMERIC EXPRESSIONS

RECURSIVE DESCENT PARSER FOR NUMERIC EXPRESSIONS

5_2007-2008 #172378
ConvertToSoundex

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.

5_2007-2008 #172384
AmtToWords

This function converts amount in words with supplied currency parameters. e.g. AmtToWords(12345.01, "GB POUND", "PENNY", "GB POUNDS", "PENNIES") will return GB POUNDS TWELVE THOUSAND THREE HUNDRED FORTY-FIVE and ONE PENNY ONLY

5_2007-2008 #172432
EBCDIC_TO_ASCII

Convert a string in EBCDIC format downloaded from an IBM mainframe to ASCII format.

5_2007-2008 #172433
ASCII_TO_EBCDIC

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.

5_2007-2008 #172434
Eval (Evaluate String Expression) *REPOST*

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.

5_2007-2008 #172441
GetToken

The following code is a Visual Basic function that returns a specific "token" (section/substring of data) from a delimited string list. The function accepts the index of the desired token and also the delimiter as specified by the programmer.

5_2007-2008 #172454
BMTEncode

Encode/Decode a string. (BMTEncode refined version). If f.ex. enter AA the 2 output chars wont be the same.

Languages
Top Categories
Global Discovery