We must specify some special non-printing ASCII characters with their byte value. Note that we used IDL's STRLEN function to return the length of the string. IDL> byte_array = str2byte( str, strlen( str ) ) This allows you to take a text string and to convert it into the equivalent array of bytes. GAMAP comes with a very useful routine called STR2BYTE. If you have an array of bytes, you can use any of the IDL string routines on them, for example: This means that it is easy to convert between strings and bytes in IDL. (Actually, the original ASCII table had 128 values, but this was later extended to 255 values to include special characters.) One byte represents a single ASCII text character. The ASCII collating sequence has 255 values. A byte is a collection of 8 bits and may express values from 0-255. In IDL, a string of text characters is equivalent to an array of byte values. You can use IDL's STRTRIM function to strip the leading and trailing whitespace. Create a new string by concatenating 2 strings by concatenating one string with another.by parsing a number with IDL's STRING function. by placing text between single and double quotes.We may form a string of text characters in IDL in the following ways: String basics Creating text and numeric strings 7 Functions for working with file and path names.1.2 Equivalence of strings and byte arrays.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |