Computer Science Canada "Substring index is greater than length of string" (error) |
Author: | gayden [ Mon Mar 02, 2015 10:17 am ] | ||
Post subject: | "Substring index is greater than length of string" (error) | ||
Task is to write a program that writes a wedge of stars. So, if you input a 7 into get x it'd look like this: ******* ****** ***** **** *** ** * Here is my code:
When I run it I get an error on line 6. I have no clue what a substring index is. |
Author: | Insectoid [ Mon Mar 02, 2015 11:24 am ] |
Post subject: | RE:"Substring index is greater than length of string" (error) |
What is line 6 supposed to do? What does the (i) part mean? |
Author: | gayden [ Mon Mar 02, 2015 3:28 pm ] |
Post subject: | Re: RE:"Substring index is greater than length of string" (error) |
Insectoid @ Mon Mar 02, 2015 11:24 am wrote: What is line 6 supposed to do? What does the (i) part mean?
I believe it was Einstein that said something like: "We cannot solve our problems with the same thinking we used when we created them." I think he's right because looking back at that line, I have no clue what I thought that should do. Turns out all I had to do was remove the (i)..embarrassing. |