English
Chinese
  yTin Online Help  

  中文主页 | Home (english) | 快快下载 | 实战教程 | 命令帮助 | 实用工具 | 常问问题 | 讨论留言 | 友好泥潭 | 我的程序 | 全球镜像 |
substr

format:         #substr {string} {index1} {length}

Similar to Perl function substr().
Currently is not as smart as Perl yet. Need specify explicitly
0 based index1 and length.
When length is <0, will count from the tail.
Return value is assigned to $_.

example:
#substr {01234567} {3} {4}
will assign {3456} to $_.
#substr {0123456789} {3} {-5}
will assign {34} to $_ since the last 5 {56789} is truncated.

Note: we do not need "strcat" command in yTin, #var {str1} {$str1$str2} will do it.

See also: #strrchr, #strstr, #strncmp, #ord, #chr