Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Telix/SALT v3.15 & RS-232, Hayes - <b>substr</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  SUBSTR

  .  Summary

  substr(str <source>, int <pos>, int <max>, str <target>);

  .  Description

  The substr function copies a portion of one string to another. Char-
  acters from position <pos> in string <source> are copied until into
  string <target> (note that SALT string offsets start at 0, not 1 as
  in some languages). Characters are copied until a 0 (NULL) value is
  encountered (normally at the end of every string), or <max> char-
  acters are copied. A 0 (NULL) is always copied at the end of the
  target string. The 0 does not count as part of the <max>. Only as
  many characters as will fit in <target> are copied.

  .  Return Value

  None.

  .  Example

  str s[] = "horse cat dog", s2;
  substr(s, 6, 3, s2);
  if (s2 == "cat")
   prints("This will always be printed");

See Also: subchrs copystr copychrs

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson