EasyManuals Logo
Home>Texas Instruments>Calculator>TI-92+

Texas Instruments TI-92+ User Manual

Texas Instruments TI-92+
507 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #356 background imageLoading...
Page #356 background image
[8.3] Creating strings that include quote characters
Suppose you want to store "abcde" in a string str1. This won't work:
""abcde"" str1 won't work!
What actually gets saved in str1 is this:
abcde*""
2
which is interesting, because the 89/92+ is interpreting the input string as
abcde * "" * ""
However, these will work:
"""abcd"""->str1
string("abcde")->str1
char(34) & "abcde" & char(34) str1
so that str1 contains ""abcde"", as you would expect. 34 is the character code for the double quote
symbol.
It is not straightforward to create strings that embed the double quote character, ", because that is also
the character that delimits strings. Suppose you need to create the string
"ab"cd"
Just typing that in won't work: you'll get the missing " error message. This will work, though:
"ab""cd" does work
This will also work:
"ab" & char(34) & "cd"
because 34 is the character code for the double quote character.
You can include two or more consecutive quotes like this:
"ab""""cd"
In general, use two quote characters for each quote you want to create.
[8.4] Count occurences of a character in a string
If you need to count how many times a particular character occurs in a string, use this:
charcnt(st,ch)
Func
©(string,char) count #char in string
Σ(when(mid(st,i,1)=ch,1,0),i,1,dim(st))
8 - 2

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TI-92+ and is the answer not in the manual?

Texas Instruments TI-92+ Specifications

General IconGeneral
BrandTexas Instruments
ModelTI-92+
CategoryCalculator
LanguageEnglish

Related product manuals