UnHtml$()

Post

Posted
Rating:
#1 (In Topic #1057)
Trainee
 Hi, is there a reverse function to the Html$()-function? Thanks!
Online now: No Back to the top

Post

Posted
Rating:
#2
Guru
BruceSteers is in the usergroup ‘Guru’

paco said

Hi, is there a reverse function to the Html$()-function? Thanks!

Probably String.FromHTML() of gb.util component
/comp/gb.util/string/fromhtml - Gambas Documentation

Maybe UnQuote() will do?
/lang/unquote - Gambas Documentation

As all Html() does is "quote" a string so it's safe for html.

or maybe FromUrl() might do what you need?
/lang/fromurl - Gambas Documentation
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Guru
cogier is in the usergroup ‘Guru’

paco said

Hi, is there a reverse function to the Html$()-function? Thanks!

Experimenting with the tricks Bruce posted, I came up with this: -

Code (gambas)

  1. Public Sub Form_Open()
  2.  
  3.   Dim sHtml As String = "Charlie was 'ere!"
  4.  
  5.   sHtml = Html(sHtml)
  6.   Print sHtml
  7.  
  8.   sHtml = String.FromHTML(sHtml)
  9.   Print sHtml
  10.  

The result: -

Charlie was 'ere!
Charlie was 'ere!
Online now: No Back to the top

Post

Posted
Rating:
#4
Trainee
Thanks! FromHTML() is not documented under String-Functions in https://gambas.sourceforge.net/en/main.html#
Online now: No Back to the top

Post

Posted
Rating:
#5
Guru
BruceSteers is in the usergroup ‘Guru’

paco said

Thanks! FromHTML() is not documented under String-Functions in https://gambas.sourceforge.net/en/main.html#

Indeed because it is not a native function but part of the component gb.util.

I have just added a gb.util string link to the "See also" part of the "String functions" page (it will not show on the wiki until tomorrow.)
Online now: No Back to the top
1 guest and 0 members have just viewed this.