RobK.StringUtils
BlitzMax Forums/BlitzMax Module Tweaks/RobK.StringUtils
| ||
This module provides useful string functions. Originally I wrote it as part of a tokeniser, but I hope others find it handy. Functions: split() 'Splits a string into an array of strings join() 'Joins an array of strings into a single string classify() 'Determines the type of text in a string, eg Numeric or Whitespace stringStart() 'Gets start of string until first occurence of a delimiter stringEnd() 'Gets end of string after last occurence of a delimiter findSubStrings() 'Finds all occurences of substring in a string createStringTree() 'Creates a StringTree from an array of strings Types: StringTree - used for creating a binary tree of strings which can be searched very quickly. Methods: toArray() find() insert() remove() map() Documentation available in the commands.htm file in the module's doc folder. Examples in demo.bmx file in the module's folder. http://www.robertknight.me.uk/files/blitz/robk.stringutils.zip |
| ||
Good range of functions there. |
| ||
very usefull functions thx |
| ||
Lanks! These are perfect! I was just starting to make my own! Talk about the glory of reusable code (and your generosity!) |
| ||
I hate dealing with strings. You got a picture? Will nail it on my timesaver of the week wall:-) |
| ||
How do you get these to work? I can't find any installation instructions. I've tried putting them in the mod folder and in the pub.mod folder but I always get the error "can't find interface for module 'pub.stringutils'". Google was no help either and I can't find documentation on how to put in a new module. |
| ||
error is on the line: Import pub.stringutils right after SuperStrict at the start of my program |
| ||
Idoit, Follow these steps: 1. Extract the robk.stringutils.zip in the {installed path}\BlitzMax\mod folder. Mine looks like this: C:\Program Files\BlitzMax\mod\robk.mod 2. Open up a Command Prompt or Click on the START Button --- RUN option, and type the following: "C:\Program Files\BlitzMax\bin\bmk.exe" makemods -a robk NOTE: You might want to replace the path if your BlitzMAX is not installed in the same location as above 3. That should build the module for you to use in BlitzMAX. 4. Just run the demo that is located the in the C:\Program Files\BlitzMax\mod\robk.mod\stringutils.mod folder or the example above. I hope that helps. Jason |
| ||
I quit blitzmax, followed your instructions above and restarted blitxmax. I get the same error "can't find interface for module 'pub.stringutils'" The command prompt didn't have print feedback or anything, so I'm just assuming it worked. |
| ||
error is on the line: Import pub.stringutils Idiot, going by the topic title, maybe you should try: Import RobK.StringUtils |
| ||
I'm sorry, but I couldn't help myself laughing when reading the replies.. :) |
| ||
Idiot, going by the topic title, maybe you should try: Import RobK.StringUtils Priceless! |
| ||
Compile Error: Identifier 'TNodeEnum' not found robk.mod/stringutils.mod/stringutils.bmx line 76 Method toArray:String[]() Local result:String[] Local enum:TNodeEnum=_tree.Keys().ObjectEnumerator() While enum.HasNext() result=result[..result.length+1] result[result.length-1]=String(enum.NextObject()) End While Return result End Method Look's like BlitzMax as change TMAP (or else) since. Any hint to fix this ? Thanks ;) |
| ||
I believe TNodeEnum is now called TNodeEnumerator. |
| ||
exellent suggestion Brucey ^^ And you know what ? Compile Error: Identifier 'FindNode' not found robk.mod/stringutils.mod/stringutils.bmx line 48 Rem bbdoc: Finds a string in a StringTree returns: True if strToFind is found, or False otherwise. End Rem Method find:Int(strToFind:String) If (_tree.FindNode(strToFind)) Return True Else Return False EndIf End Method Ahahah ^^ hope it's not endless. Why TNodeEnumerator isn't present in the doc ? Thanks ;) |
| ||
I think FindNode must changed in _FindNode. Look at BRL.Map Module for more Informations. Greet, FOODy |
| ||
Thanks you both Foody and Brucey you saved the day ^^ All systems goes ;) |