Top
Back: string type cast
Forward: string related functions
FastBack:
FastForward:
Up: string
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

4.22.4 string operations

+
concatenation

<=, >=, ==, <>
comparison (lexicographical with respect to the ASCII encoding)

string_expression [ int_expression ]
is a character of the string; the index 1 gives the first character.

string_expression [ int_expression, int_expression ]
is a substring, where the first argument is the start index and the second is the length of the substring, filled up with blanks if the length exceeds the total size of the string

string_expression [ intvec_expression ]
is a expression list of characters from the string


Example:
 
  string s="abcde";
  s[2];
==> b
  s[3,2];
==> cd
  ">>"+s[1,10]+"<<";
==> >>abcde     <<
  s[2]="BC"; s;
==> aBcde
  intvec v=1,3,5;
  s=s[v]; s;
==> ace
  s="654321"; s=s[3..5]; s;
==> 432


Top Back: string type cast Forward: string related functions FastBack: FastForward: Up: string Top: Singular Manual Contents: Table of Contents Index: Index About: About this document
            User manual for Singular version 4.4.0, 2024, generated by texi2html.