String-Handling in Dynamics NAV
Missing the READ/DATA Option form C64? (I'Ve owned a Spectrum 48!), or want to divide Memo-Fields or Colums into Navision Fields/Tablerow's? Need to compare Meyer with Mayer (i use this for un-double my Music Inventory)? Missing left,mid,right? Want to convert 123,55 to 000012355, or convert OdD wRiTTen Text to clear Readable Text? Convert between ASCII/ANSI? Some of this Functions are allready avaible, some are new in Navision. With Example's how it works and short descriptions in the Functions. The CU is self-containing, means no interaction with any other Financials-part. Just insert, test or remove the Function, no Sidekick-effect.
Object: Codeunit 50002
Functions:
DamerauLevenshtein
min
BuildPhonetic
ReplacePart
Part
Npart
Mid
Left
Right
InsertString
ReplaceString
FormatBool
FillingZero
Title
ConvertÄÖÜ Internet
Ascii<>Ansi
WordWrap
IsChar
IsNumber
ClearString
http://www.mibuso.com/dlinfo.asp?FileID=909
Discuss this download here.
Comments
Just a question: The ascii to ansi function, which character set (code page) in windows regional settings do you use? I'm guessing this function will only work in some countries?...
min (resultes the smalest of 3 Values, used internal)
BuildPhonetic (Converts string to Phonetic Spelling)
ReplacePart (Search and replace a substring in a mainstring, set to local: better switch to public, is usefull)
Part (give the Nth element of a list divided by a divider)
Npart (same as part, but returns a decimal, if possbile (else 0)
Mid (works like copystr, but easyer (as possible) to use)
Left (give the left N chars of a string)
Right (give the right N chars of a string)
InsertString (inserts a Substring into Mainstring)
ReplaceString (replace a part of the mainstring with the Substring)
FormatBool (Choose the first or second String of a Comma-list, even if empty: reminds on the Navi 3.56 handling of BoolFormat)
FillingZero (converts e.g. a 123,55 to 0000012355)
Title (converts ODD WrittEN StRiNg to Odd Written String)
ConvertÄÖÜ Internet (converts e.g. ä to ä)
Ascii<>Ansi (converts betwen german Codepage ASCII and Ansi and back)
WordWrap (converts easily a long string into Table-compatible parts)
IsChar (tests, if a single char is something like abcd (true) or more 123%$§ (false))
IsNumber (same as IsChar, but results true on 0-9)
ClearString (Removes forbidden chars out of Mainstring, you can chosse some standards (as only numbers, only chars, only Uppercase), and can spell the allowed chars)