brewersfan1976

html_end_tag_by_start_tag.rb

Jan 3rd, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.34 KB | None | 0 0
  1. def htmlEndTagByStartTag(startTag)
  2.     x = 1
  3.     endTag = "</"
  4.    
  5.     while (x < startTag.length)
  6.           if startTag[x] == ' ' or startTag[x] == '>' then
  7.              endTag = endTag + ">"
  8.              return endTag
  9.           end
  10.              
  11.           endTag = endTag + startTag[x]
  12.              
  13.           x = x + 1
  14.     end
  15. end
Advertisement
Add Comment
Please, Sign In to add comment