Đôi khi bạn có nhu cầu thay 1 chuỗi này bằng 1 chuỗi khác. Khi đó bạn có thể dùng hàm Replace. Cú pháp như sau:
Replace ( string1, find, replacement, [start, [count, [compare]]] )
Ví dụ:
Replace("alphabet", "bet", "hydro") would return "alphahydro"
Replace ("alphabet", "a", "e") would return "elphebet"
Replace("alphabet", "a", "e", 2) would return "lphebet"
Replace("alphabet", "a", "e", 1, 1) would return "elphabet"
Nguồn: techonthenet
Chủ Nhật, 22 tháng 11, 2009
Đăng ký:
Đăng Nhận xét (Atom)
Không có nhận xét nào:
Đăng nhận xét