SilentFlame

reHtml

Jun 24th, 2017
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. string convertRehtml(string str){
  2. int len = str.length();
  3. int flag =0;
  4. string temp_str;
  5. string finalStr = "";
  6. int i = 0;
  7. cout << "in" ;
  8. while(i+1 < len){
  9. if(str[i]=='[' && str[i+1]=='<'){
  10. i++;
  11. while(str[i]!='>' && str[i+1]!=']'){
  12. finalStr += str[i];
  13. i++;
  14. }
  15. finalStr += str[i];
  16. i++;
  17. }
  18. else if(str[i]=='[' && str[i+1]=='{'){
  19. i+=2;
  20. while(str[i]!='}' && str[i+1]!=']'){
  21. temp_str = "";
  22. flag = 0;
  23. if(str[i]=='<'){
  24. finalStr += str[i+1];
  25. i++;
  26. while(str[i]!=' ' && flag == 0){
  27. if(str[i]== ' '){
  28. flag = 1;
  29. break;
  30. }
  31. temp_str += str[i];
  32. finalStr += str[i];
  33. i++;
  34. }
  35. cout << temp_str;
  36. if(isInlineTags(temp_str)){
  37. rehtmlTagStack.push(temp_str);
  38. }
  39. }
  40. }
  41. }
  42. else if(str[i]=='\n'){
  43. finalStr += str[i];
  44. finalStr += " ENTER HOYA JI ";
  45. i++;
  46. }
  47. else{
  48. finalStr += str[i];
  49. i++;
  50. }
  51. }
  52. return finalStr;
  53. }
Add Comment
Please, Sign In to add comment