#] #] ********************* #] "$d_Qroot"'1_QNial handy optrs for text editing etc.txt' www.BillHowell.ca 03Jul2022 initial To view this file - use a text editor (not word processor) constant width font (eg courrier 10), tab - 3 spaces 48************************************************48 24************************24 # Table of Contents : # $ grep "^#]" "$d_Qroot"'1_QNial handy optrs for text editing etc.txt' | sed 's/^#\]/ /' 24************************24 #] +-----+ #] Unicode [chrs, sub-strings, etc] : #] many related string optrs are in lists.ndf #] str_to_unicodeL IS OP str - convert a string to a list of unicode characters (not unicode # sequences) #] str_cutUnicodeBy_chrL IS OP str chrUnicodeL - cuts str into words by removing chrL (unicode) #] str_getUnicode_chrL IS OP str chrL - cuts str into words by geting chrL (unicode) #] 18Oct2021 NEEDS FIXING!!!! #] +-----+ #] string cleanup #] str_wrapWithApos IS OP str - convert str to string with apostrophes, or if not a string return #] str_wrapWithAposAddTab IS OP str - convert str to string with apos & tab, or return input #] str_getLastNonSpcTabBefore_posn IS OP str posn - retrieves the last non-whitespace character #] chrAsStr_toUpperCase IS OP chr - convert a character to upper case, #] chrAsStr is compared to standard ASCII lower case, which is a unique (as in culled) set of chrs #] non-Unicode-capable coding #] chrAsStr_toLowerCase IS OP chr - convert a character to lower case, (non-Unicode) #] str_toUpperCase IS OP str - convert all letters in a string to upper case, (non-Unicode) #] str_toLowerCase IS OP str - convert all letters in a string to lower case, (non-Unicode) #] str_capitalize1stChrOnly IS OP str - capitalize 1st char of str, rest small, #] watch out for acronyms!, (non-Unicode) #] str_capitalize1stChrEachWord IS OP str - capitalise 1st char of each word, rest small, #] watch out for acronyms!, (non-Unicode) #] set_globalChrSets IS OP chrSet1 chrSet2 - redefine global chrSets[1,2] #] chrSets[1,2] are defined as globals to enhance the efficiency of chrSet operators!! #] note that one can link multiple charSets for g_chrSet[1,2], but must be in order, same shape #] chrAsStr_changeChrSet IS OP chrAsStr - return corresponding chrAsStr in newChrSet, #] or current chrAstr if no correspondance, must preset globals g_chrSet[1,2] #] 21Nov2021 because each chr is a string, I think this can handle unicode? #] chrL_changeChrSet IS OP chrL - change chrsAsStrs in chrL from g_chrSet1 to g_chrSet2 #] str_changeChrSet IS OP str oldChrSet newChrSet - change every oldChrSet in str to newChrSet #] str_swapChrSets IS OP str chrSet1 chrSet2 - change all chrSet1 in str to chrSet2, and visa-versa #] strURL_clean IS OP str - change all chrSet1 in str to chrSet2, and visa-versa #] str_stripAllSpacesQ IS OP Str - standard QNial library #] str_stripSpacesAll IS OP ERATION Str - removes ALL spaces from a string #] str_removeExtra_SpcTab IS OP Str - removes [leading, multiple-sequence, trailing] SpcTabs #] oldformat := setformat '%6.2f' ; #] setformat oldformat ; # enddoc