News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

StringLib library

Started by hutch--, February 18, 2022, 12:53:02 PM

Previous topic - Next topic

hutch--

A collection of string and similar functions with source, SLL and LIB. There are 21 .bas files in the zip.


  ********************************************************************************
  The library does not need these prototypes, they are for function reference only
  ********************************************************************************

   --------------
   Path functions
   --------------
' FUNCTION app_name() COMMON as STRING
' FUNCTION app_path() COMMON as STRING
' FUNCTION get_extension(src$) COMMON as STRING
' FUNCTION path_from_string(src$) COMMON as STRING

   ----------------------
   Text / Array functions
   ----------------------
' FUNCTION arr2str(arr() as STRING) COMMON as STRING
' FUNCTION str2arr(src$,arr() as STRING) COMMON as DWORD
' FUNCTION txt2arr(src$,arr() as STRING) COMMON as DWORD
' FUNCTION line2arr(src$,arr() as STRING) COMMON as DWORD

   --------------------------
   Multiline string functions
   --------------------------
' FUNCTION block_insert(src$,leadtext$,trailtxt$,OPT ByVal operator as DWORD) COMMON as STRING
' FUNCTION block_ltrim(txt$) COMMON as STRING
' FUNCTION block_monospace$(src$) COMMON
' FUNCTION block_rtrim(src$) COMMON as STRING

   -----------------------
   String length functions
   -----------------------
' FUNCTION slen(src$) COMMON as DWORD
' FUNCTION StrLen(ByVal item as DWORD) COMMON as DWORD

   -------------------------------
   Character recognition functions
   -------------------------------
' FUNCTION ischarnum(char$) COMMON as DWORD
' FUNCTION ishexnum(hxs$) COMMON as DWORD

   -------------------------------------------------------------
   Count every character in text and write the count to an array
   -------------------------------------------------------------
' FUNCTION char_count(src$,dwArr() as DWORD) COMMON as DWORD

   ----------------------------------
   Case insensitive string comparison
   ----------------------------------
' FUNCTION cmpi(txt1$, txt2$) COMMON as DWORD

   ------------------
   C string emulation
   ------------------
' FUNCTION cstr$(a$) COMMON

   ---------------------------------
   Partial string matching algorithm
   ---------------------------------
' FUNCTION partial(ByVal startat as DWORD,src$,patn$,OPT ByVal char as DWORD) COMMON as DWORD

   ------------------------------------------------------------
   Word tokeniser, a dependency for some of the above functions
   ------------------------------------------------------------
' FUNCTION wtok(ByVal pText as DWORD,ByVal pArray as DWORD) COMMON as DWORD