AME 150L Lecture Notes - Lecture 21: C String Handling, Master Sergeant

49 views2 pages

Document Summary

Ame 150: introduction to computational methods - lecture #21: strings before typed program is used by a computer each character used is encoded as a number using ascii (american standard code for information interchange) encoding. Ascii encodes 128 characters as integers 1:128. Printable characters encoded as numbers from 32 to 126 (95 total) all characters that are available on the keyboard. Others (mostly obsolete now) are control characters ex: [32:126] clist = char([32:126]); num = double(clist) Converts numbers into letters and letters into numbers can also create character arrays by putting together several strings. Domaradzki") isstrprop checks for declared category within a given string. Ex: isstrprop(ame150,"wspace") checks for where there are blank spaces in the string deblank(str) removes trailing blanks; strtrim(str) removes leading and trailing blanks. Concatenating (merging) strings result = strcat( string 1","string 2") Trailing blanks automatically removed result = strvcat( long string 1 ,"string 2") will make them of equal lengths.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers