/help/Strings.dtx

https://github.com/the-Arioch/jcl · Unknown · 3950 lines · 3883 code · 67 blank · 0 comment · 0 complexity · 01a9e65177b17ca7d571de1c5b8116a5 MD5 · raw file

Large files are truncated click here to view the full file

  1. @@StringManipulation.CharacterSearchandReplace
  2. <GROUP StringManipulation>
  3. <TITLE Character Search and Replace>
  4. <TOPICORDER 100>
  5. --------------------------------------------------------------------------------
  6. @@StringManipulation.CharacterTestRoutines
  7. <GROUP StringManipulation>
  8. <TITLE Character Test Routines>
  9. <TOPICORDER 200>
  10. --------------------------------------------------------------------------------
  11. @@StringManipulation.CharacterTransformationRoutines
  12. <GROUP StringManipulation>
  13. <TITLE Character Transformation Routines>
  14. <TOPICORDER 300>
  15. --------------------------------------------------------------------------------
  16. @@StringManipulation.Miscellaneous
  17. <GROUP StringManipulation>
  18. <TITLE Miscellaneous>
  19. <TOPICORDER 400>
  20. --------------------------------------------------------------------------------
  21. @@StringManipulation.MultiSz
  22. <GROUP StringManipulation>
  23. <TITLE MultiSz>
  24. <TOPICORDER 500>
  25. --------------------------------------------------------------------------------
  26. @@StringManipulation.PCharVector
  27. <GROUP StringManipulation>
  28. <TITLE PCharVector>
  29. <TOPICORDER 600>
  30. --------------------------------------------------------------------------------
  31. @@StringManipulation.StringExtraction
  32. <GROUP StringManipulation>
  33. <TITLE String Extraction>
  34. <TOPICORDER 700>
  35. --------------------------------------------------------------------------------
  36. @@StringManipulation.StringManagement
  37. <GROUP StringManipulation>
  38. <TITLE String Management>
  39. <TOPICORDER 800>
  40. --------------------------------------------------------------------------------
  41. @@StringManipulation.StringSearchandReplaceRoutines
  42. <GROUP StringManipulation>
  43. <TITLE String Search and Replace Routines>
  44. <TOPICORDER 900>
  45. --------------------------------------------------------------------------------
  46. @@StringManipulation.StringTestRoutines
  47. <GROUP StringManipulation>
  48. <TITLE String Test Routines>
  49. <TOPICORDER 1000>
  50. --------------------------------------------------------------------------------
  51. @@StringManipulation.StringTransformationRoutines
  52. <GROUP StringManipulation>
  53. <TITLE String Transformation Routines>
  54. <TOPICORDER 1100>
  55. --------------------------------------------------------------------------------
  56. @@StringManipulation.Tabulation
  57. <GROUP StringManipulation>
  58. <TITLE Tabulation>
  59. <TOPICORDER 1150>
  60. --------------------------------------------------------------------------------
  61. @@StringManipulation.TStringsManipulation
  62. <GROUP StringManipulation>
  63. <TITLE TStrings Manipulation>
  64. <TOPICORDER 1200>
  65. --------------------------------------------------------------------------------
  66. @@StrIsAlpha
  67. <GROUP StringManipulation.StringTestRoutines>
  68. Summary:
  69. Tests whether S contains only alpha characters.
  70. Description:
  71. StrIsAlpha tests whether the supplied string consists only of alpha characters.
  72. That is, whether or not all individual characters come from the ['a'..'z', 'A'..'Z']
  73. set.
  74. Parameters:
  75. S - The string to test
  76. Result:
  77. If S contains only alpha characters the result is True, otherwise the result is False.
  78. Notes:
  79. If S is an empty string the result is False.
  80. See also:
  81. StrConsistsOfNumberChars
  82. StrIsAlphaNum
  83. Donator:
  84. Nick Hodges
  85. --------------------------------------------------------------------------------
  86. @@StrIsAlphaNum
  87. <GROUP StringManipulation.StringTestRoutines>
  88. Summary:
  89. Tests whether S contains only alpha-numerical characters.
  90. Description:
  91. StrIsAlphaNum tests whether the supplied string consists only of alpha-numerical
  92. characters. That is, whether or not all individual characters come from
  93. the ['a'..'z', 'A'..'Z', '0'..'9'] set.
  94. Parameters:
  95. S - The string to test
  96. Result:
  97. If S contains only alpha-numerical characters the result is True, otherwise the result is False.
  98. Notes:
  99. If S is an empty string the result is False.
  100. See also:
  101. StrIsAlpha
  102. StrConsistsOfNumberChars
  103. StrIsAlphaNumUnderscore
  104. Donator:
  105. Marcel van Brakel
  106. --------------------------------------------------------------------------------
  107. @@StrIsAlphaNumUnderscore
  108. <GROUP StringManipulation.StringTestRoutines>
  109. Summary:
  110. Tests whether S contains only alpha-numerical and underscore characters.
  111. Description:
  112. StrIsAlphaNum tests whether the supplied string consists only of alpha-numerical
  113. and underscore characters. That is, whether or not all individual characters come
  114. from the ['a'..'z', 'A'..'Z', '0'..'9', '_'] set.
  115. Parameters:
  116. S - The string to test
  117. Result:
  118. If S contains only alpha-numerical and underscore characters the result is True,
  119. otherwise the result is False.
  120. Notes:
  121. If S is an empty string the result is False.
  122. See also:
  123. StrIsAlpha
  124. StrConsistsOfNumberChars
  125. Donator:
  126. Anthony Steele
  127. --------------------------------------------------------------------------------
  128. @@StrContainsChars
  129. <GROUP StringManipulation.StringTestRoutines>
  130. Summary:
  131. Determines whether a string contains a specified set of characters.
  132. Description:
  133. StrContainsChars checks whether the specified string contains at least one character
  134. that matches one of the characters in the Chars set. If CheckAll is True, the
  135. function checks whether all characters in the Chars set appear at least once in
  136. the specified string.
  137. Parameters:
  138. S - The string to test.
  139. Chars - The characters for which to test.
  140. CheckAll - If True, all characters from Chars must appear at least once in the specified string. If False, at least one of the characters in Chars must appear at least once in the specified string.
  141. Result:
  142. Returns True if the condition is met, otherwise it returns False.
  143. Donator:
  144. Petr Vones
  145. --------------------------------------------------------------------------------
  146. @@StrIsDigit
  147. <GROUP StringManipulation.StringTestRoutines>
  148. Summary:
  149. Tests whether S contains only numerical characters.
  150. Description:
  151. StrConsistsOfNumberChars tests whether the supplied string consists only of numerical characters.
  152. That is, whether or not all individual characters come from the ['0'..'9'] set.
  153. The test does not include the decimal separator. To include it in the test
  154. use StrConsistsOfNumberChars instead.
  155. Parameters:
  156. S - The string to test
  157. Result:
  158. If S contains only numerical characters the result is True, otherwise the result is False.
  159. Notes:
  160. If S is an empty string the result is False.
  161. See also:
  162. StrIsAlpha
  163. StrIsAlphaNum
  164. StrConsistsOfNumberChars
  165. Donator:
  166. Martin Kubecka
  167. --------------------------------------------------------------------------------
  168. @@StrConsistsOfNumberChars
  169. <GROUP StringManipulation.StringTestRoutines>
  170. Summary:
  171. Tests whether S contains only numerical characters.
  172. Description:
  173. StrConsistsOfNumberChars tests whether the supplied string consists only of numerical characters.
  174. That is, whether or not all individual characters come from the ['0'..'9'] set
  175. including the decimal separator. To test for numerical characters without the
  176. decimal separator, use StrIsDigit instead;
  177. Parameters:
  178. S - The string to test
  179. Result:
  180. If S contains only numerical characters the result is True, otherwise the result is False.
  181. Notes:
  182. If S is an empty string the result is False.
  183. See also:
  184. StrIsAlpha
  185. StrIsAlphaNum
  186. StrIsDigit
  187. Donator:
  188. Nick Hodges
  189. --------------------------------------------------------------------------------
  190. @@StrIsSubset
  191. <GROUP StringManipulation.StringTestRoutines>
  192. Summary:
  193. Tests whether S contains only characters from the supplied set.
  194. Description:
  195. StrIsSubset tests whether the supplied string contains only characters from the
  196. supplied character set. Keep in mind that the test is case-sensitive.
  197. Parameters:
  198. S - The string to test.
  199. ValidChars - The set of characters allowed in S.
  200. Result:
  201. If the string contains only characters from the supplied set the result is True,
  202. otherwise the result is False.
  203. Notes:
  204. If the supplied string is empty, the result is always True. If the supplied character
  205. set is empty, the result is always False. Empty string overules empty set.
  206. Donator:
  207. Marcel van Brakel
  208. --------------------------------------------------------------------------------
  209. @@StrSame
  210. <GROUP StringManipulation.StringTestRoutines>
  211. Summary:
  212. Tests two strings for equality.
  213. Description:
  214. StrSame compares the two supplied strings and returns whether or not they are
  215. identical.
  216. Parameters:
  217. S1 - First string to compare.
  218. S2 - Second string to compare.
  219. Result:
  220. If the two strings are identical the return value is True, if they are not the
  221. return value is False.
  222. See also:
  223. StrCompare
  224. Donator:
  225. Azret Botash
  226. --------------------------------------------------------------------------------
  227. @@StrCenter
  228. <GROUP StringManipulation.StringTransformationRoutines>
  229. Summary:
  230. Centers a string.
  231. Description:
  232. The StrCenter routine takes the specified string and pads it
  233. on both the left and right side with the specified character
  234. until the resulting string is of the specified length. While
  235. doing this the original string is kept centered. That is,
  236. there is the same amount of padding at the left side as there
  237. is on the right side.
  238. If the specified length is smaller than the length of the
  239. original the string remains unchanged. In cases where an odd
  240. number of padding chars have to be inserted there is always
  241. one more padding char on the right side than on the left
  242. side.
  243. Parameters:
  244. C - The character to use for padding.
  245. L - The desired length of the resulting string.
  246. S - The string to center.
  247. Result:
  248. Returns the centered string.
  249. Donator:
  250. Alexander Radchenko
  251. --------------------------------------------------------------------------------
  252. @@StrDoubleQuote
  253. <GROUP StringManipulation.StringTransformationRoutines>
  254. Summary:
  255. Returns a double-quoted version of the string.
  256. Description:
  257. StrDoubleQuote returns a copy of the string encapsulated in double quotes (").
  258. That is, if you pass in 'Project JEDI' you'll get '"Project JEDI"' back. If double
  259. quotes (") are already at the beginning and the end of the string they are added again.
  260. If they should be added only if they are not already there use StrQuote instead.
  261. Parameters:
  262. S - The string to encapsulate in quotes. Even an empty string.
  263. Result:
  264. The double-quoted version of the string.
  265. See also:
  266. StrQuote
  267. StrSingleQuote
  268. StrTrimQuotes
  269. Donator:
  270. Anthony Steele
  271. --------------------------------------------------------------------------------
  272. @@StrEnsurePrefix
  273. <GROUP StringManipulation.StringTransformationRoutines>
  274. Summary:
  275. Forces Text to start with Prefix.
  276. Description:
  277. StrEnsurePrefix tests whether the supplied text start with the supplied prefix.
  278. If it doesn't then the prefix is prepended to the string otherwise the function
  279. does nothing. Note that if Text is an empty string then the result will be Prefix.
  280. Parameters:
  281. Prefix - The prefix to test for and apply.
  282. Text - The string which must be forced to have a prefix.
  283. Result:
  284. The function result is a copy of the supplied Text, prefixed with Prefix.
  285. See also:
  286. StrEnsureNoPrefix
  287. StrEnsureSuffix
  288. Donator:
  289. Nick Hodges
  290. --------------------------------------------------------------------------------
  291. @@StrEnsureNoPrefix
  292. <GROUP StringManipulation.StringTransformationRoutines>
  293. Summary:
  294. Eventually removes Prefix from Text.
  295. Description:
  296. StrEnsureNoPrefix tests whether the supplied text start with the supplied prefix.
  297. If it does then the prefix is deleted from the string otherwise the function
  298. does nothing.
  299. Parameters:
  300. Prefix - The prefix to test for and apply.
  301. Text - The string which must not have a prefix.
  302. Result:
  303. The function result is a copy of the supplied Text, eventually minus the prefix.
  304. See also:
  305. StrEnsurePrefix
  306. StrEnsureNoSuffix
  307. Donator:
  308. Olivier Sannier
  309. --------------------------------------------------------------------------------
  310. @@StrEnsureSuffix
  311. <GROUP StringManipulation.StringTransformationRoutines>
  312. Summary:
  313. Forces Text to end with Suffix.
  314. Description:
  315. StrEnsureSuffix tests whether the supplied text ends in the supplied suffix.
  316. If it doesn't then the suffix is appended to the string otherwise the function
  317. does nothing. Note that if Text is an empty string then the result will be Suffix.
  318. Parameters:
  319. Suffix - The suffix to test for and apply.
  320. Text - The string which must be forced to have a suffix.
  321. Result:
  322. The function result is a copy of the supplied Text, with the suffix.
  323. See also:
  324. StrEnsureNoSuffix
  325. StrEnsurePrefix
  326. Donator:
  327. Marcel van Brakel
  328. --------------------------------------------------------------------------------
  329. @@StrEnsureNoSuffix
  330. <GROUP StringManipulation.StringTransformationRoutines>
  331. Summary:
  332. Eventually removes Suffix from Text.
  333. Description:
  334. StrEnsureSuffix tests whether the supplied text ends in the supplied suffix.
  335. If it does then the suffix is deleted from the string otherwise the function
  336. does nothing.
  337. Parameters:
  338. Suffix - The suffix to test for and apply.
  339. Text - The string which must not have a suffix.
  340. Result:
  341. The function result is a copy of the supplied Text, eventually minus the suffix.
  342. See also:
  343. StrEnsureSuffix
  344. StrEnsureNoPrefix
  345. Donator:
  346. Olivier Sannier
  347. --------------------------------------------------------------------------------
  348. @@StrEscapedToString
  349. <GROUP StringManipulation.StringTransformationRoutines>
  350. Summary:
  351. Converts an escaped string to a string.
  352. Description:
  353. StrEscapedToString converts a string which contains escape characters to a string
  354. without escape characters by replacing all escape characters with their string
  355. counterparts. For example, a string which contains a '\a' sequence will
  356. have the '\a' sequence replaced with the BELL character #7.
  357. The supported escape characters are:
  358. <TABLE>
  359. Character Value Constant Description
  360. --------- ----- --------- ------------------
  361. \a #7 BELL Bell
  362. \b #8 BACKSPACE Backspace
  363. \f #12 FF Form Feed
  364. \n #10 LR Line Feed
  365. \r #13 CR Carrage Return
  366. \t #9 TAB Tabulator
  367. \v #11 VT Vertical Tabulator
  368. \\ N/A N/A Backslash
  369. \" N/A N/A Double quotes
  370. </TABLE>
  371. In addition it supports hexadecimal escape sequences (sequences that start with \x)
  372. and octal escape sequences (sequences starting with '\0', '\1' ... '\9').
  373. The StrStringToEscaped is the "inverse" of this function.
  374. Parameters:
  375. S - The "escaped" string to convert to a "normal" string.
  376. Result:
  377. The string with all escape characters replaced with their string counterparts.
  378. See also:
  379. StrStringToEscaped
  380. Donator:
  381. Robert Marquardt
  382. --------------------------------------------------------------------------------
  383. @@StrLower
  384. <GROUP StringManipulation.StringTransformationRoutines>
  385. Summary:
  386. Lowercases all characters in a string.
  387. Description:
  388. StrLower returns a copy of the string, converted to lowercase. That is, if you pass in 'Project JEDI' you'll get 'project jedi'.
  389. Parameters:
  390. S - String to convert to lowercase.
  391. See also:
  392. StrLowerInPLace
  393. StrLowerBuff
  394. StrUpper
  395. StrUpperInPlace
  396. StrUpperBuff
  397. Donator:
  398. Pelle F. S. Liljendal
  399. --------------------------------------------------------------------------------
  400. @@StrLowerInPlace
  401. <GROUP StringManipulation.StringTransformationRoutines>
  402. Summary:
  403. Lowercases all characters in a string.
  404. Description:
  405. StrLower converts all characters in the supplied string to lowercase.
  406. Parameters:
  407. S - String to convert to lowercase.
  408. See also:
  409. StrLower
  410. StrLowerBuff
  411. StrUpper
  412. StrUpperInPlace
  413. StrUpperBuff
  414. Donator:
  415. Azret Botash
  416. --------------------------------------------------------------------------------
  417. @@StrLowerBuff
  418. <GROUP StringManipulation.StringTransformationRoutines>
  419. Summary:
  420. Lowercases all characters in a string.
  421. Description:
  422. StrLowerBuff converts all characters in the supplied string to lowercase.
  423. Parameters:
  424. P - String to convert to lowercase.
  425. See also:
  426. StrLower
  427. StrLowerInPlace
  428. StrUpper
  429. StrUpperInPlace
  430. StrUpperBuff
  431. Donator:
  432. Azret Botash
  433. --------------------------------------------------------------------------------
  434. @@StrMove
  435. <GROUP StringManipulation.StringTransformationRoutines>
  436. Summary:
  437. Copies a sub-string from one string to another.
  438. Description:
  439. StrMove copies Count characters starting at FromIndex in the source string to
  440. the destination string starting at ToIndex. The function checks the passed
  441. parameters and if any is illegal the function does nothing. This includes
  442. illegal indices and, for example, a zero-length destination string.
  443. Parameters:
  444. Dest - The destination string which the sub-string is copied to.
  445. Source - The source string from which the sub-string is copied.
  446. ToIndex - The index into the destination string at which the sub-string is copied.
  447. FromIndex - The starting index into the source string from which count characters are copied.
  448. Count - Length of the sub-string to copy in characters.
  449. Donator:
  450. Azret Botash
  451. --------------------------------------------------------------------------------
  452. @@StrPadLeft
  453. <GROUP StringManipulation.StringTransformationRoutines>
  454. Summary:
  455. Left pads a string with characters.
  456. Description:
  457. StrPadLeft left pads a string with the specified character until the resulting
  458. string is Len characters long. If the source string is already greater than or
  459. equal in length to Len the function does nothing.
  460. Parameters:
  461. S - Source string to left pad.
  462. Len - The length of the resulting string.
  463. C - The character to pad the string with.
  464. Result:
  465. The string left padded with the specified character.
  466. See also:
  467. StrPadRight
  468. StrCenter
  469. Donator:
  470. Marcel van Brakel
  471. --------------------------------------------------------------------------------
  472. @@StrPadRight
  473. <GROUP StringManipulation.StringTransformationRoutines>
  474. Summary:
  475. Right pads a string with characters.
  476. Description:
  477. StrPadRight right pads a string with the specified character until the resulting
  478. string is Len characters long. If the source string is already greater than or equal
  479. in length to Len the function does nothing.
  480. Parameters:
  481. S - Source string to right pad.
  482. Len - The length of the resulting string.
  483. C - The character to pad the string with.
  484. Result:
  485. The string right padded with the specified character.
  486. See also:
  487. StrPadLeft
  488. StrCenter
  489. Donator:
  490. Marcel van Brakel
  491. --------------------------------------------------------------------------------
  492. @@StrProper
  493. <GROUP StringManipulation.StringTransformationRoutines>
  494. Summary:
  495. Lowercases the supplied string and uppercases the first character.
  496. Description:
  497. The StrProper routine lowercases the entire string and subsequently uppercases
  498. the first character.
  499. Parameters:
  500. S - The string to transform.
  501. Result:
  502. The transformed string.
  503. Donator:
  504. Azret Botash
  505. --------------------------------------------------------------------------------
  506. @@StrProperBuff
  507. <GROUP StringManipulation.StringTransformationRoutines>
  508. Summary:
  509. Lowercases the supplied string and uppercases the first character.
  510. Description:
  511. The StrProper routine lowercases the entire string and subsequently uppercases
  512. the first character.
  513. Parameters:
  514. S - The string to transform.
  515. Donator:
  516. Azret Botash
  517. --------------------------------------------------------------------------------
  518. @@StrQuote
  519. <GROUP StringManipulation.StringTransformationRoutines>
  520. Summary:
  521. Quotes a string with a specific character.
  522. Description:
  523. StrQuote quotes the string with a specified character. Upon return the string is
  524. guarenteed to begin and end with the specified character. Note that if the string
  525. already starts or ends with this character, it is not added again.
  526. Parameters:
  527. S - The string to quote.
  528. C - The character with which to quote the string.
  529. Result:
  530. The quoted string.
  531. Donator:
  532. Azret Botash
  533. --------------------------------------------------------------------------------
  534. @@StrRemoveChars
  535. <GROUP StringManipulation.StringTransformationRoutines>
  536. Summary:
  537. Removes a set of characters from a string.
  538. Description:
  539. StrRemoveChars removes all instances of the characters in the set from the source
  540. string. For example, if you pass in 'Joint Endeavour of Delphi Innovators' and
  541. specify ['e', 'a', 'o', 'u', 'i'] the resulting string will be 'Jnt Endvr f Dlph Innvtrs'.
  542. Parameters:
  543. S - The source string from which to remove the characters.
  544. Chars - The set of characters which are removed from S.
  545. Result:
  546. The string with all characters from the supplied set removed.
  547. Notes:
  548. The function is case sensitive. That is, specifying 'e' will not remove 'E'.
  549. Donator:
  550. Marcel van Brakel
  551. --------------------------------------------------------------------------------
  552. @@StrRepeat
  553. <GROUP StringManipulation.StringTransformationRoutines>
  554. Summary:
  555. Repeats a string Count number of times.
  556. Description:
  557. The StrRepeat routine returns a string consisting of the specified string, repeated
  558. Count number of times. For example, StrRepeat('He', 3) returns 'HeHeHe'.
  559. Parameters:
  560. S - The string to repeat.
  561. Count - The number of times to repeat the specified string.
  562. Result:
  563. The specified string, repeated Count number of times.
  564. Donator:
  565. Marcel van Brakel
  566. --------------------------------------------------------------------------------
  567. @@StrReverse
  568. <GROUP StringManipulation.StringTransformationRoutines>
  569. Summary:
  570. Reverses a string.
  571. Description:
  572. StrReverse returns a reversed copy of S. That is, if you pass in 'Delphi' the
  573. function result will be 'ihpleD'. Note that the original string remains unmodified,
  574. as the const modifier indicates. If you don't need the original string after
  575. reversing it, then do not write code like S := StrReverse(S) but instead use
  576. the StrReverseInPlace function because it's much faster.
  577. Parameters:
  578. S - The string to reverse.
  579. Result:
  580. A reversed copy of the supplied string.
  581. See also:
  582. StrReverseInPlace
  583. Donator:
  584. Marcel van Brakel
  585. --------------------------------------------------------------------------------
  586. @@StrReverseInPlace
  587. <GROUP StringManipulation.StringTransformationRoutines>
  588. Summary:
  589. Reverses a string.
  590. Description:
  591. StrReverse reverses S. That is, if you pass in 'Delphi' then after the function
  592. returns S contains the string 'ihpleD'. If you need to retain the original
  593. string then use the StrReverse function instead.
  594. Parameters:
  595. S - The string to reverse.
  596. See also:
  597. StrReverse
  598. Donator:
  599. Marcel van Brakel
  600. --------------------------------------------------------------------------------
  601. @@StrSingleQuote
  602. <GROUP StringManipulation.StringTransformationRoutines>
  603. Summary:
  604. Returns a single-quoted version of the string.
  605. Description:
  606. StrSingleQuote returns a copy of the string encapsulated in single quotes (').
  607. That is, if you pass in 'Project JEDI' you'll get ''Project JEDI'' back.
  608. Parameters:
  609. S - The string to encapsulate in quotes. Even an empty string.
  610. Result:
  611. The single-quoted version of the string.
  612. See also:
  613. StrDoubleQuote
  614. StrTrimQuotes
  615. Donator:
  616. Anthony Steele
  617. --------------------------------------------------------------------------------
  618. @@StrSmartCase
  619. <GROUP StringManipulation.StringTransformationRoutines>
  620. Summary:
  621. Converts a string to 'smartcase' or 'camelcase'.
  622. Description:
  623. StrSmartCase converts specified characters within the supplied source string to
  624. uppercase. The characters that are uppercased are determined by the Delimiters
  625. character set. Each time the function finds a character in the source string that
  626. is also present in the Delimiters set it uppercases the next character
  627. in the source string. In addition, the function always converts the first character
  628. to uppercase. For example, if you call StrSmartCase('project jedi rules', [' '])
  629. the function returns 'Project Jedi Rules'. As you can see, all characters that
  630. immediately follow a space (as specified by Delimiters) are uppercased.
  631. Parameters:
  632. S - Source string.
  633. Delimiters - Set of characters to use as delimiters. These characters determine which other
  634. characters are uppercased. If you supply an empty set the function assumes you want to use a
  635. space only. That is, it sets Delimiters to [' '].
  636. Result:
  637. The string converted to smart case.
  638. Notes:
  639. Original author is John C Molyneux (jaymol@hotmail.com). Function was rewritten by
  640. Marcel van Brakel.
  641. Donator:
  642. Marcel van Brakel
  643. --------------------------------------------------------------------------------
  644. @@StrStringToEscaped
  645. <GROUP StringManipulation.StringTransformationRoutines>
  646. Summary:
  647. Converts a string to an escaped string.
  648. Description:
  649. StrStringToEscaped converts a string to an escaped string by replacing non-visual
  650. character sequences with their escape characters. For example, if a string contains
  651. the character #7 the resulting string will have the #7 character replaced with the '\a'
  652. sequence. This function is the inverse of StrEscapedToString.
  653. The function supports the following escape characters:
  654. <TABLE>
  655. Character Value Constant Description
  656. --------- ----- --------- ------------------
  657. \a #7 BELL Bell
  658. \b #8 BACKSPACE Backspace
  659. \f #12 FF Form Feed
  660. \n #10 LR Line Feed
  661. \r #13 CR Carrage Return
  662. \t #9 TAB Tabulator
  663. \v #11 VT Vertical Tabulator
  664. \\ N/A N/A Backslash
  665. \" N/A N/A Double quotes
  666. </TABLE>
  667. All other characters whose ordinal value are smaller than Ord(' ') are escaped
  668. as a hexadecimal sequence like '\x01'. The StrEscapedToString is the "inverse"
  669. of this function.
  670. Parameters:
  671. S - The string to convert to an escaped string.
  672. Result:
  673. The "escaped" string.
  674. See also:
  675. StrEscapedToString
  676. Donator:
  677. Robert Marquardt
  678. --------------------------------------------------------------------------------
  679. @@StrStripNonNumberChars
  680. <GROUP StringManipulation.StringTransformationRoutines>
  681. Summary:
  682. Removes all non-number characters from a string.
  683. Description:
  684. StrStripNonNumberChars removes all non-number characters from the specified string.
  685. Hence the resulting string will contain only number characters. Testing whether
  686. the individual characters are numbers is done using the CharIsNumberChar routine and
  687. therefore characters that qualify are all digits (0..9), signs (+, -) and decimal
  688. separators.
  689. Parameters:
  690. S - The string from which to remove non-number characters.
  691. Result:
  692. The string after all non-number characters are removed.
  693. Donator:
  694. Anthony Steele
  695. --------------------------------------------------------------------------------
  696. @@StrTrimQuotes
  697. <GROUP StringManipulation.StringTransformationRoutines>
  698. Summary:
  699. Removes surrounding quotes from the supplied string.
  700. Description:
  701. StrTrimQuotes removes surrounding quotes, either single or double-quotes, from
  702. the string. For example if you pass in ''Project JEDI'' you'll get 'Project JEDI'
  703. back. Note that this function only removes quotes if the string both begins and
  704. ends with the same quote character.
  705. Parameters:
  706. S - The string to unquote.
  707. Result:
  708. The unquoted string.
  709. See also:
  710. StrSingleQuote
  711. StrDoubleQuote
  712. Donator:
  713. Anthony Steele
  714. --------------------------------------------------------------------------------
  715. @@StrToHex
  716. <GROUP StringManipulation.StringTransformationRoutines>
  717. Summary:
  718. Converts a string of hex digit pairs to the corresponding bytes.
  719. Description:
  720. The Source string is expected to contain pairs of hex digit
  721. characters ['0'..'9', 'a'..'f', 'A'..'F']. Each pair is converted to a single
  722. byte thus converting '40' to '@'. Any character not from the hex set
  723. results in an empty string. If the string length of the Source is odd
  724. then a '0' is prepended internally to make up the first byte.
  725. Parameters:
  726. S - A string of hex digit pairs to be converted.
  727. Result:
  728. The string of converted bytes.
  729. Donator:
  730. Azret Botash
  731. --------------------------------------------------------------------------------
  732. @@StrTrimCharLeft
  733. <GROUP StringManipulation.StringTransformationRoutines>
  734. Summary:
  735. Removes leading characters from a string.
  736. Description:
  737. The StrTrimCharLeft routine removes leading characters from the specified string.
  738. For example, StrTrimCharLeft('000123', '0') returns '123'.
  739. Parameters:
  740. S - The source string from which the leading characters need to be removed.
  741. C - The character to remove.
  742. Result:
  743. The function returns the source string S without any leading characters C.
  744. See also:
  745. StrTrimCharRight
  746. Donator:
  747. Jack N.A. Bakker
  748. --------------------------------------------------------------------------------
  749. @@StrTrimCharRight
  750. <GROUP StringManipulation.StringTransformationRoutines>
  751. Summary:
  752. Removes trailing characters from a string.
  753. Description:
  754. The StrTrimCharRight routine removes trailing characters from the specified string.
  755. For example, StrTrimCharRight('123000', '0') returns '123'.
  756. Parameters:
  757. S - The source string from which the trailing characters need to be removed.
  758. C - The character to remove.
  759. Result:
  760. The function returns the source string S without any trailing characters C.
  761. See also:
  762. StrTrimCharLeft
  763. Donator:
  764. Jack N.A. Bakker
  765. --------------------------------------------------------------------------------
  766. @@StrUpper
  767. <GROUP StringManipulation.StringTransformationRoutines>
  768. Summary:
  769. Uppercases all characters in a string
  770. Description:
  771. StrUpper returns a copy of the string, converted to uppercase. That is, if you pass
  772. in 'Project JEDI' you'll get 'PROJECT JEDI'.
  773. Parameters:
  774. S - String to convert to uppercase.
  775. See also:
  776. StrUpperInPlace
  777. StrUpperBuff
  778. StrLower
  779. StrLowerInPlace
  780. StrLowerBuff
  781. Donator:
  782. Azret Botash
  783. --------------------------------------------------------------------------------
  784. @@StrUpperInPlace
  785. <GROUP StringManipulation.StringTransformationRoutines>
  786. Summary:
  787. Uppercases all characters in a string.
  788. Description:
  789. StrUpper converts all characters in the supplied string to uppercase.
  790. Parameters:
  791. S - String to convert to uppercase.
  792. See also:
  793. StrUpper
  794. StrUpperBuff
  795. StrLower
  796. StrLowerInPlace
  797. StrLowerBuff
  798. Donator:
  799. Azret Botash
  800. --------------------------------------------------------------------------------
  801. @@StrUpperBuff
  802. <GROUP StringManipulation.StringTransformationRoutines>
  803. Summary:
  804. Uppercases all characters in a string.
  805. Description:
  806. StrUpper converts all characters in the supplied string to uppercase.
  807. Parameters:
  808. S - String to convert to uppercase.
  809. See also:
  810. StrUpper
  811. StrUpperInPlace
  812. StrLower
  813. StrLowerInPlace
  814. StrLowerBuff
  815. Donator:
  816. Azret Botash
  817. --------------------------------------------------------------------------------
  818. @@StrAddRef
  819. <GROUP StringManipulation.StringManagement>
  820. Summary:
  821. Increments the reference count of a long string.
  822. Description:
  823. The StrAddRef routine increments the reference count of the specified long string.
  824. Explicitly incrementing a strings reference count forces Delphi to keep the string
  825. in memory even if the variable itself goes out of scope and all other references
  826. were removed already. Note that if the string points to a string constant this
  827. routine will call UniqueString on it forcing a string copy, after which the
  828. reference count becomes 1.
  829. Parameters:
  830. S - The long string whose reference count to increment.
  831. See also:
  832. StrDecRef
  833. Donator:
  834. Marcel van Brakel
  835. --------------------------------------------------------------------------------
  836. @@StrAllocSize
  837. <GROUP StringManipulation.StringManagement>
  838. Summary:
  839. Returns the memory allocated to store the string.
  840. Description:
  841. A long string variable is a 4 byte pointer to a dynamically allocated block of
  842. memory. This block of memory holds the actual string data, including a NULL
  843. character. In addition this block of memory has, at a negative offset, a number
  844. of 32 bit values used to manage the string. The StringAllocSize function looks
  845. at this negative offset to determine the total amount of dynamic memory reserved
  846. to hold the string and management data.
  847. Note that this function will always return 0 for string literals, string constants
  848. and string variables that are assigned to string constants, but haven't been
  849. modified yet. This is not a bug but a result of the way in which Delphi manages
  850. string constants.
  851. Parameters:
  852. S - The string for which to determine the total amount of used memory.
  853. Result:
  854. The amount of dynamic memory allocated for the string or 0 in the exceptions noted
  855. above. Note that, at least in Delphi 5, the result will always be a multiple of 4.
  856. Notes:
  857. This function relies on pseudo-undocumented knowledge and should only be used for
  858. debugging purposes.
  859. See also:
  860. StrRefCount
  861. Donator:
  862. Marcel van Brakel
  863. --------------------------------------------------------------------------------
  864. @@StrDecRef
  865. <GROUP StringManipulation.StringManagement>
  866. Summary:
  867. Decrements the reference count of a long string.
  868. Description:
  869. The StrDecRef routine decrements the reference count of the specified long string.
  870. Note that if decrementing the reference count will set it to 0 the string is
  871. released and the string pointer is set to nil. Therefore the string may be
  872. inaccessible after calling this routine.
  873. Parameters:
  874. S - The long string whose reference count to increment. Upon return the string may
  875. have been freed.
  876. See also:
  877. StrDecRef
  878. Donator:
  879. Marcel van Brakel
  880. --------------------------------------------------------------------------------
  881. @@StrLen
  882. <GROUP StringManipulation.StringManagement>
  883. Summary:
  884. Returns the length of the supplied string.
  885. Description:
  886. StrLen returns the length of the supplied string, in characters, excluding the
  887. null terminating character. This function is identical to the StrLen routine from
  888. SysUtils.pas except that it is much faster.
  889. Parameters:
  890. S - Pointer to the null terminated string for which to determine the length.
  891. Result:
  892. The length of the string, in characters.
  893. Donator:
  894. Robert Lee
  895. --------------------------------------------------------------------------------
  896. @@StrLength
  897. <GROUP StringManipulation.StringManagement>
  898. Summary:
  899. Returns the length of the supplied string.
  900. Description:
  901. StrLength returns the length of the supplied string. This is a duplication of the
  902. standard Delphi Length function and is only supplied for completeness. You should
  903. prefer the Length function over StrLength.
  904. Parameters:
  905. S - The string for which to determine the length.
  906. Result:
  907. The length of the string in characters.
  908. Notes:
  909. This function relies on pseudo undocumented knowledge.
  910. See also:
  911. StrAllocSize
  912. StrRefCount
  913. Donator:
  914. Marcel van Brakel
  915. --------------------------------------------------------------------------------
  916. @@StrRefCount
  917. <GROUP StringManipulation.StringManagement>
  918. Summary:
  919. Returns the reference count of the supplied string.
  920. Description:
  921. StrRefCount returns the reference count of the string. Note that this function
  922. will always return -1 for string literals, string constants and string variables
  923. that are assigned to string constants, but haven't been modified yet. This is
  924. not a bug but a result of the way in which Delphi manages string constants.
  925. Parameters:
  926. S - String for which to determine the reference count.
  927. Result:
  928. The reference count of the string or -1 if the string ultimately points to a
  929. string constant.
  930. Notes:
  931. This function relies on pseudo-undocumented knowledge and should only be used for
  932. debugging purposes.
  933. See also:
  934. StrAllocSize
  935. Donator:
  936. Marcel van Brakel
  937. --------------------------------------------------------------------------------
  938. @@StrResetLength
  939. <GROUP StringManipulation.StringManagement>
  940. Summary:
  941. Resets the length of the supplied string.
  942. Description:
  943. StrResetLength resets the length of the string to encompass only the actual number
  944. of used characters. This is particularly useful when passing strings to API
  945. functions which accept PChar's. These kind of functions do modify the string but
  946. since they are unaware of how Delphi manages strings, the length is not changed
  947. on return. Depending on how you use the string from that point on the results
  948. may be incorrect if you do not apply StrResetLength.
  949. The function resets the length to the C string length, i. e. the length up to the first #0 byte.
  950. Parameters:
  951. S - The string whose length to reset.
  952. Donator:
  953. Marcel van Brakel
  954. --------------------------------------------------------------------------------
  955. @@StrCharCount
  956. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  957. Summary:
  958. Counts the occurrences of a character in a string.
  959. Description:
  960. StrCharCount returns the number of occurrences of the specified character in the
  961. supplied string.
  962. Parameters:
  963. S - Source string.
  964. C - The character whose occurrences to count.
  965. Result:
  966. The number of occurrences of C in S.
  967. Donator:
  968. Massimo Maria Ghisalberti
  969. --------------------------------------------------------------------------------
  970. @@StrCompare
  971. <GROUP StringManipulation.StringTestRoutines>
  972. Summary:
  973. Compares two strings.
  974. Description:
  975. StrCompare implements a case-insensitive comparison between the two supplied
  976. strings. If the two strings match the function returns 0 otherwise it returns
  977. the number of different characters. If the supplied strings are of equal length
  978. but are not identical the function returns the difference of the first mismatched
  979. character. The table below demonstrates this:
  980. <TABLE>
  981. S1 S2 Result
  982. ------------ ------------ ------------------------------
  983. jedi jedi 0
  984. jedi je 2
  985. di jedi -2
  986. project jedi jedi 8
  987. jedi project jedi -8
  988. jedi judi Ord('e') - Ord('u')
  989. JEDI Judi Ord(LowerCase('E')) - Ord('u')
  990. </TABLE>
  991. Parameters:
  992. S1 - First string to compare.
  993. S2 - Second string to compare.
  994. Result:
  995. StrCompare returns 0 if the two strings match or the number of different characters
  996. in case of a mismatch.
  997. Donator:
  998. Azret Botash
  999. --------------------------------------------------------------------------------
  1000. @@StrCompareRange
  1001. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1002. Description:
  1003. StrCompareRange compares, case-sensitive, a sub-string from the
  1004. first supplied string with the second string. If the two
  1005. strings are identical the function returns 0 otherwise it
  1006. returns an indication of difference between the two strings,
  1007. The result is equal to the result returned by StrCompare. This
  1008. function is particularly useful to avoid code such as: "if
  1009. Copy(S, 1, 4) = 'JEDI' then ..." which is quite inefficient.
  1010. This code would be rewritten to: "if StrCompareRange(S1,
  1011. 'JEDI', 1, 4) = 0 then ...".
  1012. Summary:
  1013. Compares two (sub) strings.
  1014. Parameters:
  1015. Count - Number of characters of the sub-string in S1 to compare to S2.
  1016. Index - Starting index of sub-string in S1 to.
  1017. S1 - First string to compare.
  1018. S2 - Second string to compare.
  1019. Result:
  1020. StrCompareRange returns 0 if the two strings match or the
  1021. number of different characters in case of a mismatch.
  1022. See also:
  1023. StrCompare
  1024. Donator:
  1025. Azret Botash
  1026. --------------------------------------------------------------------------------
  1027. @@StrFillChar
  1028. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1029. Summary:
  1030. Creates a string consisting of the specified character repeated Count times.
  1031. Description:
  1032. The StrFillChar routine returns a string consisting of the specified character
  1033. repeated Count number of times.
  1034. Parameters:
  1035. C - The character to repeat.
  1036. Count - The number of times to repeat the character.
  1037. Result:
  1038. A string consisting of the specified character repeated Count times.
  1039. Donator:
  1040. Marcel van Brakel
  1041. --------------------------------------------------------------------------------
  1042. @@StrFind
  1043. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1044. Summary:
  1045. Returns the index of the first character in a specified sub-string that occurs in a given string.
  1046. Description:
  1047. StrFind returns the index of the first character in a specified sub-string that
  1048. occurs in a given string. The search starts at the supplied index and is case-insensitive.
  1049. Parameters:
  1050. Substr - The sub-string to search for.
  1051. Str - The string in which to search.
  1052. Index - The index in Str at which to start the search.
  1053. Result:
  1054. One-based index of the first character of SubStr in Str or 0 if SubStr does not
  1055. occur in the supplied string.
  1056. See also:
  1057. StrSearch
  1058. Donator:
  1059. Azret Botash
  1060. --------------------------------------------------------------------------------
  1061. @@StrHasPrefix
  1062. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1063. Summary:
  1064. Returns whether a string is prefixed by one of the supplied strings.
  1065. Description:
  1066. StrHasPrefix returns whether the string is prefixed with at least one of the strings
  1067. supplied in the Prefixes array. In other words, for each string in the Prefixes
  1068. array it's determined if the supplied string starts with that prefix. Note that
  1069. the routine exits as soon as a match is found and matching is case-sensitive (use
  1070. StrIHasPrefix for a case-insensitive matching version).
  1071. Parameters:
  1072. S - The string to test.
  1073. Prefixes - Array of prefixes to test for.
  1074. Result:
  1075. If the supplied string is prefixed with one of the supplied prefixes the routine
  1076. returns True, otherwise it returns False.
  1077. See also:
  1078. StrIHasPrefix, StrPrefixIndex
  1079. Donator:
  1080. Anthony Steele
  1081. --------------------------------------------------------------------------------
  1082. @@StrIHasPrefix
  1083. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1084. Summary:
  1085. Returns whether a string is prefixed by one of the supplied strings.
  1086. Description:
  1087. StrHasPrefix returns whether the string is prefixed with at least one of the strings
  1088. supplied in the Prefixes array. In other words, for each string in the Prefixes
  1089. array it's determined if the supplied string starts with that prefix. Note that
  1090. the routine exits as soon as a match is found and matching is case-insensitive (use
  1091. StrHasPrefix for a case-sensitive matching version).
  1092. Parameters:
  1093. S - The string to test.
  1094. Prefixes - Array of prefixes to test for.
  1095. Result:
  1096. If the supplied string is prefixed with one of the supplied prefixes the routine
  1097. returns True, otherwise it returns False.
  1098. See also:
  1099. StrHasPrefix, StrIPrefixIndex
  1100. Donator:
  1101. Anthony Steele
  1102. --------------------------------------------------------------------------------
  1103. @@StrIndex
  1104. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1105. Summary:
  1106. Returns the index of a string in an array of strings.
  1107. Description:
  1108. StrIndex returns the index into the List array at which S is positioned. This is
  1109. particularly useful to create a case statement based on string labels. For example:
  1110. case StrIndex(S, ['zero', 'one', 'two']) of
  1111. 0: // handle case where S = 'zero'
  1112. 1: // handle case where S = 'one'
  1113. 2: // handle case where S = 'two'
  1114. else
  1115. //
  1116. end;
  1117. Parameters:
  1118. S - The string to test.
  1119. List - Array of strings to search in.
  1120. Result:
  1121. If the supplied string exists in the List array the zero based index of the position
  1122. at which it appears is returned. If the string doesn't exist in the array -1 is
  1123. returned. Note that the string comparison is case insensitive but is based on the
  1124. current locale (ie it uses AnsiSameText).
  1125. Donator:
  1126. Anthony Steele
  1127. --------------------------------------------------------------------------------
  1128. @@StrILastPos
  1129. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1130. Summary:
  1131. Returns the index of the last occurrence of SubStr in S.
  1132. Description:
  1133. StrILastPos scans the supplied string and returns the index of the first character
  1134. of the last occurrence of the supplied sub-string. The comparison is case-insensitive.
  1135. Parameters:
  1136. SubStr - The sub-string to find the last occurrence of.
  1137. S - The string in which to search.
  1138. Result:
  1139. The index of the last occurrence of SubStr in S. If the sub-string does not exist
  1140. at all the result is 0.
  1141. See also:
  1142. StrLastPos
  1143. Donator:
  1144. Anthony Steele
  1145. --------------------------------------------------------------------------------
  1146. @@StrLastPos
  1147. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1148. Summary:
  1149. Returns the index of the last occurrence of SubStr in S.
  1150. Description:
  1151. StrLastPos scans the supplied string and returns the index of the first character
  1152. of the last occurrence of the supplied sub-string. The comparison is case-sensitive.
  1153. Parameters:
  1154. SubStr - The sub-string to find the last occurrence of.
  1155. S - The string in which to search.
  1156. Result:
  1157. The index of the last occurrence of SubStr in S. If the sub-string does not exist
  1158. at all the result is 0.
  1159. See also:
  1160. StrILastPos
  1161. Donator:
  1162. Marcel van Brakel
  1163. --------------------------------------------------------------------------------
  1164. @@StrIPos
  1165. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1166. Summary:
  1167. Returns the index of the first occurrence of SubStr in S.
  1168. Description:
  1169. StrIPos scans the supplied string and returns the index of the first character
  1170. of the first occurrence of the supplied sub-string. The comparison is case-insensitive.
  1171. Parameters:
  1172. SubStr - The sub-string to find the first occurrence of.
  1173. S - The string in which to search.
  1174. Result:
  1175. The index of the first occurrence of SubStr in S. If the sub-string does not exist
  1176. at all the result is 0.
  1177. Donator:
  1178. Anthony Steele
  1179. --------------------------------------------------------------------------------
  1180. @@StrIPrefixIndex
  1181. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1182. Summary:
  1183. Returns the index at which a string appears which is used as a prefix.
  1184. Description:
  1185. StrPrefixIndex returns the index into the prefixes array at which a string appears
  1186. with which the supplied string is prefixed. For example,
  1187. StrPrefixIndex('banana', ['call', 'ban', 'bana']) will return 1. Note that as
  1188. can be seen from the example, as soon as a prefix is found the routine stops and
  1189. doesn't attempt to find a better (longer) match. Matching is case-insensitive; use
  1190. StrPrefixIndex for a case-insensitive version.
  1191. Parameters:
  1192. S - The string to test.
  1193. Prefixes - The list of prefixes.
  1194. Result:
  1195. The zero based index into Prefixes at which the first string appears that is used
  1196. as a prefix in the supplied string. If none of the Prefixes array strings qualifies
  1197. the result is -1.
  1198. See Also
  1199. StrIHasPrefix, StrPrefixIndex
  1200. Donator:
  1201. Anthony Steele
  1202. --------------------------------------------------------------------------------
  1203. @@StrIsOneOf
  1204. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1205. Summary:
  1206. Tests whether the supplied string exists in the list of strings.
  1207. Description:
  1208. StrIsOneOf tests whether the supplied string exists in the list of strings. Note
  1209. that the comparison is case-insensitive.
  1210. Parameters:
  1211. S - The string to test.
  1212. List - The list of string in which to search.
  1213. Result:
  1214. If the string exists in the supplied list the result is True, otherwise it's False.
  1215. Donator:
  1216. Anthony Steele
  1217. --------------------------------------------------------------------------------
  1218. @@StrNPos
  1219. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1220. Summary:
  1221. Returns the position of the N-th occurence of a sub-string within a string.
  1222. Description:
  1223. StrNPos returns the index into S of the N-th occurence of the specified sub-string.
  1224. This function is case-sensitive and does not work with multibyte character sets.
  1225. If the specified sub-string does not have N occurence in S the function returns 0.
  1226. Parameters:
  1227. S - The string in which to search for N occurences of SubStr.
  1228. SubStr - The sub-string to search for.
  1229. Index - The number of occurences of sub-string in S.
  1230. Result:
  1231. Index into S where the N-th occurence of SubStr is located. If SubStr has less
  1232. than N occurences in S the result is 0.
  1233. Notes:
  1234. This function was inspired by code submitted by George Tasker
  1235. See also:
  1236. StrNIPos
  1237. Donator:
  1238. Team JCL
  1239. --------------------------------------------------------------------------------
  1240. @@StrNIPos
  1241. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1242. Summary:
  1243. Returns the position of the N-th occurence of a sub-string within a string.
  1244. Description:
  1245. StrNPos returns the index into S of the N-th occurence of the specified sub-string.
  1246. This function is case-insensitive and does not work with multibyte character sets.
  1247. If the specified sub-string does not have N occurence in S the function returns 0.
  1248. Parameters:
  1249. S - The string in which to search for N occurences of SubStr.
  1250. SubStr - The sub-string to search for.
  1251. N - The number of occurences of sub-string in S.
  1252. Result:
  1253. Index into S where the N-th occurence of SubStr is located. If SubStr has less
  1254. than N occurences in S the result is 0.
  1255. Notes:
  1256. This function was inspired by code submitted by George Tasker
  1257. See also:
  1258. StrNPos
  1259. Donator:
  1260. Team JCL
  1261. --------------------------------------------------------------------------------
  1262. @@StrMatch
  1263. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1264. Summary:
  1265. Returns the index of the first character in a specified sub-string that occurs in a given string.
  1266. Description:
  1267. StrMatch returns the index of the first character in a specified sub-string that
  1268. occurs in a given string. The search starts at the supplied index and is case-insensitive.
  1269. The specified sub-string may contain wildcards. The '?' wildcard matches 1 character
  1270. while the '*' wildcard matches 0 or more occurrences of a character. For example, 'J?DI'
  1271. will find 'JEDI', 'JZDI' and 'JODI' (and more) while 'J*I' will find 'JEDI' and 'JI'.
  1272. Parameters:
  1273. Substr - The sub-string to search for. May contain wildcards.
  1274. Str - The string in which to search.
  1275. Index - The index in Str at which to start the search.
  1276. Result:
  1277. One-based index of the first character of SubStr in Str or 0 if SubStr does not
  1278. occur in the supplied string.
  1279. Notes:
  1280. The '*' wildcard currently doesn't work correctly, it produces the same result as '?'.
  1281. See also:
  1282. StrSearch
  1283. Donator:
  1284. Azret Botash
  1285. --------------------------------------------------------------------------------
  1286. @@StrPrefixIndex
  1287. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1288. Summary:
  1289. Returns the index at which a string appears which is used as a prefix.
  1290. Description:
  1291. StrPrefixIndex returns the index into the prefixes array at which a string appears
  1292. with which the supplied string is prefixed. F