Results for "Category: String Manipulation"
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.
' 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).
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.
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.
This is in response to a question on posted on the Programming Q & A section. It takes a string and fills a listbox with all combinations of the letters in the string (could be adapted to use a dynamic array, too, the listbox was better for demonstration purposes). This program use recursion to get it's results and may be a good example for someone learning the concept to step through. Warning: The number of combinations goes up exponentially! more than 8 characters will work but really bog down your PC!
This is kind of a Virus Scanner...It's to let you get the feel of a scanner which searches for strings a virus might have and then displays that it is a virus in a message box. Put this in a module and call it from like a button or something. I am only 13 so if you think this code is dumb or wouldn't work...sorry im still learning. E-Mail me at BmFWaLk316@Juno.com if you have any problems. Later.
Get the current username from Windows
This is a very simple encrypt/unenceypt and when i say simple i mean simple. works for any string containg the normal chr's ie. (1-9,a-z). Works good tho for simple encrypt.
Fixes a string.. from "chArlES IS BaCk!" and the results is "Charles Is Back!" easy to use.. and nothing to have.. ;-) made it for a request.. the StrConv() only function in vb6 i think.. i'm not sure.. However this works too if you want it..
Quick and Easy! without API. Only a few lines of code. You can scroll your Application's titles and form's caption. I hope you enjoy. G.B.R.Nilantha Athurupana. Wattarama,Imbulgasdeniya,Sri Lanka.(94-03744479, E-Mail: crysbro@cga.lk)
Easy! without API. Only a few lines of code.You can scroll your Status bar panel's text and You can modify suit to you.I hope you enjoy & your correctons,comments,Ideas are very gratefully. G.B.R.Nilantha Athurupana. Wattarama,Imbulgasdeniya,Sri Lanka.(94-03744479, E-Mail: crysbro@cga.lk)
Very fast function to encode or decode Quoted-Printable. VB6 only, but you can make it work with other versions, with a 3rd party replace function.
This code displays the text on the line the mouse is over in the tooltiptext box. This is useful for when your text string is longer than the textbox can display.