TAILIEUCHUNG - Working with String and Selection Classes

Làm việc với các String và lựa chọn lớp học Là một trong những lớp học phổ biến nhất được sử dụng, lớp String sử dụng phương pháp có thể hữu ích để sửa đổi và xây dựng chuỗi-báo-kèm theo các giá trị có chứa thông tin (như cái tên "Jobe") có thể dễ dàng hiểu được con người | Working with String and Selection Classes As one of the most commonly used classes the String class uses methods that can be helpful for modifying and building strings quote-enclosed values that contain information like the name Jobe that can be easily understood by humans. var message String No shoes no service The script creates a variable named message whose value is a string. In such cases you can think of the variable itself as a String object an instance of the String class which means you can use String class methods to manipulate its value. Let s look at a few examples. The toUpperCase method of the String class forces a string to become all uppercase letters message The script modifies the variable message to contain NO SHOES NO SERVICE For the opposite effect that is to force the entire string to become all lowercase letters you would apply toLowerCase in the same fashion. Note that the text value of a text field instance the text within the field is considered an instance of the String object. If message were the name of a text field instance the previous script could be rewritten like this Although it is most common to create a String object the easy way var message String Hello it is also possible to create a String object by using the constructor of the String class. var message String new String Hello Is there any advantage to using one over the other Not really every project is different and you may find cases where one seems to be more appropriate than the other. To review you can create an instance of the String object by Using a constructor for example var myNewStringObject String new String Hello . The String object is identified as myNewStringObject. Assigning a string value to a variable. The String object is identified as the name of the variable. Creating a text field. The String object is identified as the text property of the field as in . Another useful method .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.