Count a String using an integer; delete a character and then restart the count from next character
-
Hi All, I am facing a weird kinda problem. Can't figure the solution. Here is the problem. I have a string "FLAMES". This is a fixed string. I want to start counting the string characters till it reaches the value of an integer 'n' say the value of n = 7. So what I is want is the code to start counting from F,L,A,M,E,S now at n = 6 the string finishes, so n = 7 will be "F". Now at the last count of n whatever alphabet is there it should get scrapped off. In this case "F" gets scrapped off. The reamining string is "LAMES". Then restart the count from "L" till n = 7 and this time the alphabet that gets scrapped will be "A", the remaining string is "LMES" Again restart the count from next character which in this case is "M". Repeat this procedure untill there is only one alphabet remaining in "FLAMES". In this case of n = 7 it should be "E" Can anybody help in this? I'm really stuck at this. Thanks in advance for any help. Manik
-
Hi All, I am facing a weird kinda problem. Can't figure the solution. Here is the problem. I have a string "FLAMES". This is a fixed string. I want to start counting the string characters till it reaches the value of an integer 'n' say the value of n = 7. So what I is want is the code to start counting from F,L,A,M,E,S now at n = 6 the string finishes, so n = 7 will be "F". Now at the last count of n whatever alphabet is there it should get scrapped off. In this case "F" gets scrapped off. The reamining string is "LAMES". Then restart the count from "L" till n = 7 and this time the alphabet that gets scrapped will be "A", the remaining string is "LMES" Again restart the count from next character which in this case is "M". Repeat this procedure untill there is only one alphabet remaining in "FLAMES". In this case of n = 7 it should be "E" Can anybody help in this? I'm really stuck at this. Thanks in advance for any help. Manik
Sounds like some incredibly simple homework to me. We're not going to do it for you, you have to try yourself. It's set so you can learn, not because the world needs this program to exist. So, what have you tried ? Think about the task, think about how to logically break down the steps you want to take. If you're stuck when you bothered to try yourself, you might post code here and ask a SPECIFIC question.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
Hi All, I am facing a weird kinda problem. Can't figure the solution. Here is the problem. I have a string "FLAMES". This is a fixed string. I want to start counting the string characters till it reaches the value of an integer 'n' say the value of n = 7. So what I is want is the code to start counting from F,L,A,M,E,S now at n = 6 the string finishes, so n = 7 will be "F". Now at the last count of n whatever alphabet is there it should get scrapped off. In this case "F" gets scrapped off. The reamining string is "LAMES". Then restart the count from "L" till n = 7 and this time the alphabet that gets scrapped will be "A", the remaining string is "LMES" Again restart the count from next character which in this case is "M". Repeat this procedure untill there is only one alphabet remaining in "FLAMES". In this case of n = 7 it should be "E" Can anybody help in this? I'm really stuck at this. Thanks in advance for any help. Manik
Here is a tip...
SubString
Steve Jowett ------------------------- Real programmers don't comment their code. If it was hard to write, it should be hard to read.
-
Hi All, I am facing a weird kinda problem. Can't figure the solution. Here is the problem. I have a string "FLAMES". This is a fixed string. I want to start counting the string characters till it reaches the value of an integer 'n' say the value of n = 7. So what I is want is the code to start counting from F,L,A,M,E,S now at n = 6 the string finishes, so n = 7 will be "F". Now at the last count of n whatever alphabet is there it should get scrapped off. In this case "F" gets scrapped off. The reamining string is "LAMES". Then restart the count from "L" till n = 7 and this time the alphabet that gets scrapped will be "A", the remaining string is "LMES" Again restart the count from next character which in this case is "M". Repeat this procedure untill there is only one alphabet remaining in "FLAMES". In this case of n = 7 it should be "E" Can anybody help in this? I'm really stuck at this. Thanks in advance for any help. Manik