Syntax highlighting

Results 1 to 3 of 3

Thread: Syntax highlighting

  1. #1
    Join Date
    Dec 1969

    Default Syntax highlighting

    How would I get text thats sent through a form on an asp page to get syntax highlighting like it does below? I&#039;ve searched google quite a few times, and all I&#039;m getting are text-editing programs :(<BR><BR><BR>[code language="VBScript"]<BR>If something = "whatever" Then<BR> Response.Write("somethign here")<BR>End If<BR>[/code]

  2. #2
    Join Date
    Dec 1969

    Default RE: Syntax highlighting

    The replace function should solve this problem for you... <BR><BR>If you watned to bold the work BOB every time it shows up in the string string..<BR><BR>Response.Write Replace(string,"BOB","&#060;B&#062;BOB&#060;/B&#062;")<BR><BR>Hope that helps..<BR><BR>Bill<BR>

  3. #3
    Join Date
    Dec 1969

    Default But needless to say...

    ...this can get very very very slow as you keep replacing more and more keywords.<BR><BR>Look into using regular expressions, instead.<BR><BR>Still using replace, but a regexp-based replace, instead.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts