Bài 11. Kiểu chuỗi (xâu)

Kiểu chuỗi (String) cho phép ta lưu trữ giá trị ở dạng bảng chữ cái gồm một dãy ký tự(khác với kiểu Char chỉ là một ký tự).

Khai báo:

var <tên biến>:string[max];

Ví dụ

[codesyntax lang="pascal"]

var hoten:string[30];

var socmt:string;

[/codesyntax]

Chú ý: Nếu không khai báo độ dài max, thì max = 255; tức là chuỗi đó có tối đa 255 ký tự.

Các thao tác xử lý chuỗi

  1. Ghép xâu (Nối xâu)
  2. So sánh
  3. Xoá (Delete)
  4. Chèn (Insert)
  5. Sao chép (Copy)
  6. Độ dài (Length)
  7. Vị trí (Pos)
  8. Upcase
This entry was posted in Pascal. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

yup! xinchao! xacuop! sorry smile! reng! ohgod! nice! miu! meoxinh! leuleu! lac! hic! hi! heo! help! han! gou! good! ghost! fh! cute! byebye! bikini! ;)) :D :)) :)