Computer Science Canada

Str

Author:  dymd3z [ Mon Apr 30, 2007 8:44 am ]
Post subject:  Str

Sorry, I seem to be posting a lot but I'm in my grade 12 year yet im taking both computer sciences 11 and 12 in the same semester so its quite difficult for me. I'm just wondering what Str is and how I use it output the character length of a word, how to output a certain character in a word, etc...

Author:  Carey [ Wed May 02, 2007 9:17 am ]
Post subject:  Re: Str

Str is a unit that contains routines for manipulating strings. Look in the Turing help file for details.

Turing:

var word : string := "dymd3z"

%Find the length
put Str.length (word)
%or
put length (word)
%outputs the length of word

%Output a certain character in a word (using substrings)
put word (4)
%puts the 4th char in word (d)


Hope that helps. In the future look at the Turing help file or the Turing Walkthrough for help first


: