Tim Driven Development | Test until the fear goes away
Tim Driven Development | Test until the fear goes away
Dinu Claudiu wrote:Your solution should only traverse the string once.
Tim Driven Development | Test until the fear goes away
Tim Driven Development | Test until the fear goes away
Tim Driven Development | Test until the fear goes away
Tim Driven Development | Test until the fear goes away
Being Java programmer.
would you please explain little more how? because I did this program & I also used integer literals in it 65 97 etc.Campbell Ritchie wrote:Don't use the integer literals 65 and 97; those are error‑prone.
For that we can check whether character is between 'A' to 'Z' or 'a' to 'z' then go for increment code else skip that special character and go for next character.What do you say? I did that in my program & entered those characters & it works fine.That trick, unfortunately, probably only works for English text and will probably go wrong with letters like é, ß, or ç.
Being Java programmer.
Tim Driven Development | Test until the fear goes away
But one day you will write 67 and 95 or 64 and 96.Ganish Patil wrote:. . . would you please explain little more how? because I did this program & I also used integer literals in it 65 97 etc.
One of those letters is in common use in French: look here, and you find. . . For that we can check whether character is between 'A' to 'Z' or 'a' to 'z' then go for increment code . . .
The number 231 is 7 × 32 + 7, so what are you going to do with it? Ignore it and have François called Franois? Use it with % 32 and get 7 and put it in the same category as g/G? É would go in the same category as I. You can create a lookup table with a Map or a switch, but that is going to take much longer than this exercise merits. Simpler to stick to English text which does not usually have any diacritics.ç or ç
small c, cedilla (ç or ç)
Haha yes you're correct, changed my code.Campbell Ritchie wrote:But one day you will write 67 and 95 or 64 and 96.
Ohh I see, had no notion about this, then better stick to english text.The number 231 is 7 × 32 + 7, so what are you going to do with it? Ignore it and have François called Franois? Use it with % 32 and get 7 and put it in the same category as g/G? É would go in the same category as I. You can create a lookup table with a Map or a switch, but that is going to take much longer than this exercise merits. Simpler to stick to English text which does not usually have any diacritics.
Being Java programmer.
You didn't tell me he was so big. Unlike this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|