Results for "Category: String Manipulation"
ClsExtendedRTF.Cls version 3 for RichTextBox extensive rewrite, recode and rename. Mostly about manipulating RTF code to change text and background colours. Now includes API and RTF based higlighting(Not selection, this is the RichTextBox equivalant of highlihter pens). Highlighting with: API advantage it can detect highlighting; disadvantage single colour at a time RTF advantage multicolour highlighting. disadvantage can't detect itself. ClsAPIZoom for RichTtextBox, a few lines of code and your RTBox is zoomable. cLsManifestation (incorperated from my other upload) Gives compiled program user's choice of Classic or WindowsXP(if they have XP) added panels(form) which give you greater control over highlight, text colour and text format. *New* Materials interface you can create your own materials colour schemes. *New* Styles; if you create a text and background colour scheme you want to reuse save it with a name and access through the RTF Font Painter tool and class. fixed small bug in RemoveFormatting which added a space to start;(if selection was at start of doc) see earlier versions for mor details.
Function that counts the occurrance of a given phrase in a larger string. (I needed this function and couldn't find anything like it in MSDN for VB)
Ever wanted the ability to run a 'smart' search, ie, with full and's, or's, not's, xor's, brackets (even nested brackets), and "". Basically like a search engine? This is the vb code to do it for you. An example expression would be: animals and ((cats or feline) or (dogs or canine)) and "is cuddly" Very usefull and very easy to implement
After looking here and a few other places for a simple code that allows only numerals and not to allow text to be pasted into a textbox and with no prevail I figured it out. Not a major thing but for beginners this will help them.
This is a recursive function to calculate a string formula. For example: You have a formula like "3*((2+6)*2-2)/(2+2)". You just call the function to get the answer. Hope this is useful to somebody:)
This code is the equivalence of the bitwise complement C opertator (~), except this only works on strings. I got tired of not having this capability, so I wrote it =)
This code with scan through a string looking for a delimiter of your choice, and will put the text inbetween the delimiters into seperate elements of an array.
Convert a string in EBCDIC format downloaded from an IBM mainframe to ASCII format.
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.
Generates a random string of numbers, letters and symbols, then places it in a string. Once this has been done 3399 times (or times set by user) it writes the string to a file under the variable filelocation
Replaces a character in a string with another character. Pretty simple to understand. Uses a For...Next loop.
ever made a program capable of showing barcodes ? if you did than you`ve been there ,,, at the oficial EAN standards site,, than you would have seen how to calculate the check digit. they hold the standard they publish that standard also on their website ,,, http://www.ean-int.org/index800.html i never found code in VB that calculates the check digit ,, so my conclusion is that it was hold for comercial reassons ( there are lots of controls out there for a lot of monney :-) so i donate this M. Posseth code to the public and make it public domain ,,, uhmmm votes would be apreciated :-)
Removes extra spaces from given string. eg. Squeeze("^^too^^many^^^spaces^^")returns "too^many^spaces". NB.Read a carat ^ as a single space above. Planet Source code mangles multiple spaces in submitted text.
This is just an update to the nice piece of code submitted by VF-fCRO on 1/12/2002. I simply added some small features (elapsed time, a different way to loop, minor text edits, etc). Doesn't really change the purpose of the original, just adds a few touches to it. the original is at http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=30734&lngWId=1 I wouldn't really entitle VF-fCRO's submission a "mistake"; he/she actually submitted a demonstration of a better way to handle concatenating strings with a far faster technique, and it doesn't use and API calls or weird, esoteric methods.
This demo allows you to compare and benchmark 3 methods of XML Parsing available to VB. 1. String Manipulation The first method is basic VB string manipulation, using functions such as Instr() and Mid(). 2. MSXML Document Object Model The second method uses the DOM methods provided with MSXML. 3. MSXML 3.0 SAX2 The final method uses the new SAX2 technology provided with MSXML 3.0. The benchmarking results will prove that SAX2 scales linearly while the DOM and VB string methods scale exponentially. SAX2 proves to be a highly scalable solution for parsing large XML recordset. This demo will be useful for those who are interesting in learning about XML parsing in VB, and especially useful for those who want to take advantage of Microsoft's new MSXML SAX2 technology. All the VB wrapper classes you will need are included with this demo. Before you run this demo, you will need to install Microsoft's MSXML 3.0 library. For instructions, see the Instructions.txt file included with the project. Don't forget to vote!!!
Makes a string http querystring friendly by replacing all non-alpha and non-numeric characters with the appropriate hex code. Helpful when using the wininet API. example: "(Find This)" becomes "%28Find%20This%29"
This is a series of Has.. Codes. It will search a textbox for the following: Lowercase letter, Uppercase letters, Numeric Characters, and Accented Characters. So, if it has lowercase letters or something, it will display a message box. this is a good example of how to use for..next loops, ASCII codes and the Instr Function, then again, this might be a lousy example, you be the judge.
This function searches a text string for possible phone numbers and returns an array of those numbers. It allows you to specify a default area code, too. (If you know an easier or more elegant way to do this, let me know!) Doesn't work for international numbers.
Converts a long address (2220112843) to it's IP address (203.59.84.132)
Revised Roman Numeral generator. This version will in theory generate numbers in excess of 1000000 using the standard numbering conventions, i.e. 5000 is equal to a V with a line above and below..