Advertisement

Results for "Category: String Manipulation"

C_Volume2 #75666
Advanced INI Functions

This code is the first posted on Planet-Source-Code to do more than just ADD and GET INFO from INI files. You can now also DELETE Keys, Values, EVEN SECTIONS. I am working to create functions to rename sections and keys also. Enjoy this code! Fully explained!

C_Volume2 #75708
Print hexpackets with WinSock

This is a simple example of converting a string data into a hex formatted (packet) view. This will be mostly usefull when sending and receiving data with/through WinSock! Packet displays data in hex and 'readable' characters like the packet below, which seems to be the text you're reading right at this time! 48 65 6C 6C 6F 2C 0D 0A 0D 0A 54 68 69 73 20 69 Hello,....This.i 73 20 61 6E 20 65 78 61 6D 70 6C 65 20 6F 66 20 s.an.example.of. 63 6F 6E 76 65 72 74 69 6E 67 20 61 20 73 74 72 converting.a.str 69 6E 67 20 64 61 74 61 20 69 6E 74 6F 20 61 20 ing.data.into.a. 68 65 78 20 66 6F 72 6D 61 74 74 65 64 20 28 70 hex.formatted.(p 61 63 6B 65 74 29 20 76 69 65 77 2E 0D 0A 54 68 acket).view...Th 69 73 20 77 69 6C 6C 20 62 65 20 6D 6F 73 74 6C is.will.be.mostl 79 20 75 73 65 66 75 6C 6C 20 77 68 65 6E 20 73 y.usefull.when.s 65 6E 64 69 6E 67 20 61 6E 64 20 72 65 63 65 69 ending.and.recei 76 69 6E 67 20 64 61 74 61 20 77 69 74 68 2F 74 ving.data.with/t 68 72 6F 75 67 68 20 57 69 6E 53 6F 63 6B 21 0D hrough.WinSock!. 0A 0D 0A 50 61 63 6B 65 74 20 64 69 73 70 6C 61 ...Packet.displa 79 73 20 64 61 74 61 20 69 6E 20 68 65 78 20 61 ys.data.in.hex.a 6E 64 20 27 72 65 61 64 61 62 6C 65 27 20 63 68 nd.'readable'.ch 61 72 61 63 74 65 72 73 20 6C 69 6B 65 20 74 68 aracters.like.th 65 20 70 61 63 6B 65 74 20 62 65 6C 6F 77 2C 0D e.packet.below,. 0A 77 68 69 63 68 20 73 65 65 6D 73 20 74 6F 20 .which.seems.to. 62 65 20 74 68 65 20 74 65 78 74 20 79 6F 75 27 be.the.text.you' 72 65 20 72 65 61 64 69 6E 67 20 72 69 67 68 74 re.reading.right 20 61 74 20 74 68 69 73 20 74 69 6D 65 21 .at.this.time!

C_Volume2 #75732
clsExtendeRTF ver 3 for RichTextBox

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.

C_Volume2 #75735
StrCount function

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)

C_Volume2 #75761
A boolean expression parser, complete search engine like support for and, or, not, brackets, "", etc

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

C_Volume2 #75835
Allow Numerals Only

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.

C_Volume2 #75959
String Calculator

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

C_Volume2 #76050
Get the binary inverse of a string

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

C_Volume2 #76086
Parse a delimited string into an array

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.

C_Volume2 #76093
EBCDIC_TO_ASCII

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

C_Volume2 #76094
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.

C_Volume2 #76107
Generate Random Numbers, letters and symbols

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

C_Volume2 #76113
Easily Replace a character in a string

Replaces a character in a string with another character. Pretty simple to understand. Uses a For...Next loop.

C_Volume2 #76254
calculate the EAN ( barcode) check digit

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

C_Volume2 #76258
Squeeze

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.

C_Volume2 #76261
Biggest common "mistake" in VB - update Jan 16

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.

C_Volume2 #76381
Scalable XML Parsing Demo, featuring Microsoft's new MSXML SAX2 technology!

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!!!

C_Volume2 #76424
HTTPSafeString

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"

C_Volume2 #76432
Has... String Functions

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.

C_Volume2 #76439
FindPhoneNo

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.

Languages
Top Categories
Global Discovery