Advertisement

Results for "Category: String Manipulation"

7_2009-2012 #217529
How to use VB's InStr with a String

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

7_2009-2012 #217537
Mike's String Checker

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

7_2009-2012 #217578
rtf2html-2.1

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.

7_2009-2012 #217579
RevInStr

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

7_2009-2012 #217589
noresizeform

DUHH

7_2009-2012 #217590
Add Quotes

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.

7_2009-2012 #217606
String Replace *THE FASTEST*

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.

7_2009-2012 #217634
Registration Key

A little app that I made to generate a key according to username. Also this app will validate the key. This is a little bit more advanced. Most validation routines actually take the username that is put in, and generates a key for that. Then it will compare that and what the user entered. This leaves a big security hole because anybody with memory editors can actually use the actual program as the keygen. My app actually reverse engineers the key into a username then compares usernames. =) have fun and change it as you like. Also, please vote!

7_2009-2012 #217680
***Convert TXT file to Executable EXE***

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

7_2009-2012 #217695
A Function that removes all of a chr from a string

This is a fairly basic code, but I had someone ask me how to do it, so I figured since I made it I might as well post it. Basicly this is a simple function which you can add to either a bas, or a form, and then you call it, and it removes all occurenses of a character within a string. IE.(My name is steve) if you wanted to remove all the spaces you could use this.

7_2009-2012 #217700
A simple credits scrolling example using BitBlt

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.

7_2009-2012 #217712
ExtractArgument

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.

7_2009-2012 #217728
Find and Highlight Substring

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

7_2009-2012 #217741
Strip HTML tags

This following function takes an HTML page and strips it of all tags.

7_2009-2012 #217747
getstr

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.

7_2009-2012 #217756
Autocompleter for textboxes-Like IntelliSense

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

7_2009-2012 #217758
Count number of lines/returns in a textbox

Simply counts the number of lines in a textbox (the textbox should be multiline=true, otherwise it is pretty useless). Put this in a module so it can be reused.

7_2009-2012 #217761
A smaller encryption example

Takes a string and shifts each character in that string according to a password set by the user. Much smaller than most of the examples of PSC.

7_2009-2012 #217764
Display SQL Results

Display a page that allows you to type in a SQL Query statement, and display the results in HTML Table format. The number of field parameters and field names are immaterial. It will display the results in an easy to read format. Great for customer reports. The Code will not allow an Update or Delete query.

7_2009-2012 #217797
ADO Database Sample

Teaches you how to allow your users to build a dynamic sql statment for searching your database, paging (nice little auto paging function I wrote included), dynamic sorting, etc... Access 2000 sample database included.

Languages
Top Categories
Global Discovery