|
| mat1989 (16) | |||
| Hi making a program to detect html tags ( as well as other things) and then convert any tags that contain an upper-case character, to lower-case, then outputting it to a second specified file without altering the original file. Could someone give me an idea of how to do this? My program is miscalculating the amount of tags in the file, so if someone could also give me some tips for getting that to work correctly; I'd appreciate it. My code is below Thanks.
| |||
| Umz (182) | |
| Fair start, one point to note is that line 66 will count exclamation marks used in punction also. To output the characters in small your lines 45 and 46 have code between them that check if the character after a tag is small and make it uppercase. Although you'll have to put in extra work later with HTML tags like <a href><src><img> as many of them use multiple values. | |
| mat1989 (16) | |
| Thanks Umz, but I am alittle confused, what exactly should I do with lines 45 and 46. Do you know how to edit line 66 so it will count correctly? Thanks | |
| eker676 (423) | |
| You could get the next character. If it is a alpha numeric add one to comments. If it is a bracket > don't add one. That's just a suggestion. Some people code differently than others so you will have to devise a method. | |
| Umz (182) | |
| eker676 has a great solution for the commenting. If you want the program to output all tags in lower case you will have to add code between 45 and 46 that will: Read in the file and check which tags are uppercase. Turn these to lower case and output that line. Then your output file will have only lowercase tags. | |
This topic is archived - New replies not allowed.
