Computer Science Canada String Substitution |
Author: | tum_twish [ Thu Apr 17, 2003 9:58 am ] |
Post subject: | String Substitution |
I have string that displays the sum of various numbers. The string is concatenated in a loop. However, at the end of the calculation, an extra "+" displays. How can I remove that plus sign? ie. 2+5+7+9+10+=33 How do I remove the last + sign? Thanx. |
Author: | jamez [ Thu Apr 17, 2003 10:22 am ] |
Post subject: | |
hmm can i see teh code? |
Author: | Lone]2 [ Thu Apr 17, 2003 10:28 am ] |
Post subject: | |
maybe you're just exiting the loop too late. try exiting the loop sooner so that the "+" wont show up at the end of your equation |
Author: | tum_twish [ Thu Apr 17, 2003 10:41 am ] | ||
Post subject: | |||
|
Author: | Blade [ Thu Apr 17, 2003 10:42 am ] |
Post subject: | |
please, if you are having problems with code or anything like that, please post the code... or even give an example of what you want... in your case the example wont help much so please post the code... |
Author: | tomako [ Thu Apr 17, 2003 10:47 am ] |
Post subject: | |
im not good at programming, but logically speaking, y dont u just forget about displaying the "+"s? u can put a space or sumthing instead ![]() |
Author: | Office of the Registar [ Thu Apr 17, 2003 2:29 pm ] |
Post subject: | |
that's the kind of attitude that should get you kicked out of this field tomako ![]() |
Author: | Office of the Registar [ Thu Apr 17, 2003 2:43 pm ] |
Post subject: | |
i can't beleive you guys are just wasting time like this |
Author: | Leafs Fan [ Thu Apr 17, 2003 2:45 pm ] |
Post subject: | |
course heheh |
Author: | Tony [ Thu Apr 17, 2003 2:56 pm ] |
Post subject: | |
you can use substrings to get rid of the last character (the unwanted +) word := word(1..*-1) then you add "= whatever" |
Author: | yuethomas [ Thu Apr 17, 2003 10:37 pm ] | ||
Post subject: | |||
Or, don't append the plus sign... do an if statement for it
notequal: I forgot the operator for it. ~=? |