2014年3月10日 星期一

張貼範例

在撰寫文章時,有"撰寫"和"HTML"兩個選項,
選用HTML編輯,
張貼程式碼時,
依照下面格式張貼:

<pre class="brush: java;" name="code">
 ....撰寫程式碼
</pre>

輸出結果會如下:
class DemoApp {
    public static void main(String[] args) {
        Demo d = new Demo();
        d.printMessage();
    }
}
 
class Demo {
    String message = "NTUT 214 無敵";
     
    public void printMessage() {
        System.out.println(message);
    }
}
其中比較常用到的特殊符號要置換成別的字元:
'&' (ampersand) becomes '&amp;'
"' (double quote) becomes '&quot;' when ENT_NOQUOTES is not set.     
''' (single quote) becomes '&#039;' only when ENT_QUOTES is set.     
'<' (less than) becomes '&lt;'
'>' (greater than) becomes '&gt;'


沒有留言 :

張貼留言