home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1994 June / NEBULA_SE.ISO / SourceCode / MiscKit / Examples / MiscString / output < prev    next >
Encoding:
Text File  |  1994-01-13  |  2.7 KB  |  70 lines

  1. string1 = "The first string.", length = 17.
  2. string2 = "01234567890123456789", length = 20.
  3. String1 + String2 = "The first string.01234567890123456789", length = 37.
  4. String1 = "The first string.", length = 17.
  5. string1!=string1: 0, string1!=string2: -1
  6. left5 = 01234 right5 = 56789 mid5to10 = 567890 mid6len5 = 67890
  7. Substrings from string1 and "first"...Left:"The " Right:"first string."
  8. Extract parts from "don:*:23:21:Don Yacktman:/LocalLibrary/Users/don:/bin/csh" delimiting with ':':
  9.     Part    #3 is "23"
  10.     Part   #10 is "(null pointer)"
  11. Return was nil.
  12.     First part is "don"
  13.     Last  part is "/bin/csh"
  14. Extract all parts with while loop:
  15.     part #0 is: "don".
  16.     part #1 is: "*".
  17.     part #2 is: "23".
  18.     part #3 is: "21".
  19.     part #4 is: "Don Yacktman".
  20.     part #5 is: "/LocalLibrary/Users/don".
  21.     part #6 is: "/bin/csh".
  22. Given:        /Net/darth/Users/don/Projects/daymisckit_proj/daymisckit-1/DAYString.m
  23.     Path is:  /Net/darth/Users/don/Projects/daymisckit_proj/daymisckit-1
  24. Filename is:  DAYString.m
  25. Carl's string: "   Hello, how are you?   ", length = 25
  26. Numwords: 4
  27. 3rd word: "are"
  28. trimmed: "Hello, how are you?"
  29. Numwords: 4
  30. Reversed: "?uoy era woh ,olleH"
  31. Reversed again: "Hello, how are you?"
  32. ToUpper:  "HELLO, HOW ARE YOU?"
  33. ToLower:  "hello, how are you?"
  34. Inserting "Oh! " at 0:  "Oh! hello, how are you?"
  35. Char at 0: 'O'
  36. ReplaceFrom 0to2 with "YOHO!":  "YOHO! hello, how are you?"
  37. spotOf 'o': 10
  38. spotOf 'o' nocase: 1
  39. rspotOf 'O': 3
  40. rspotOf 'O' nocase: 22
  41. 10th rspotOf 'O': -1
  42. replace "YOHO!" with "My!": "My! hello, how are you?"
  43. String now is "  Hello,   I    am  fine today.  Right?  "
  44. Squashed: "Hello, I am fine today.  Right?"
  45. endcmp "Right?": 0
  46. endcasecmp "RIGHT?": 0
  47. endcmp "RIGHT?": 1
  48. endcasecmp n:3 "nacHT?": 0
  49. replaceCharAt:0 with 'J': "Jello, I am fine today.  Right?"
  50. insertChar 'a' at 1: "Jaello, I am fine today.  Right?"
  51. Not empty ("not empty"): NO  (length = 9)
  52. Empty ("(null pointer)"): YES  (length = 0)
  53. Replace all 'i' with '!':  "Someth!ng w!cked th!s way comes.".
  54. catStrings:  "one two three four five".
  55. concatenateStrings:  "One Two Three Four Five".
  56. String now is "Something wicked this way comes."
  57. (All tests below restart with above string)
  58. Number of 's': 2
  59. Number of 's' nocase: 3
  60. Replace all 's' with '!':  "Something wicked thi! way come!.".
  61. Replace all 's' with 's' nocase:  "something wicked this way comes.".
  62. Replace all 's' with "Hi!":  "Something wicked thiHi! way comeHi!.".
  63. Replace all 's' with "Hi!" nocase:  "Hi!omething wicked thiHi! way comeHi!.".
  64. Replace all 's' with "" nocase:  "omething wicked thi way come.".
  65. numOfChars 'siw' nocase: 8
  66. spotOfChars 'siw': 6
  67. spotOfChars 'siopen w' nocase: 0
  68. spotOfChars 'siw' #3 nocase: 11
  69. Replace all 'siw' with '!' nocase:  "!ometh!ng !!cked th!! !ay come!.".
  70.