Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JAVA×Ö·û´®Àà

import java.util.*;
import java.util.regex.Pattern;
public class StrTools {
/**
* ·Ö¸î×Ö·û´®
*
* @param str String ԭʼ×Ö·û´®
* @param splitsign String ·Ö¸ô·û
* @return String[] ·Ö¸îºóµÄ×Ö·û´®Êý×é
*/
@SuppressWarnings("unchecked")
public static String[] split(String str, String splitsign) {
int index;
if (str == null || splitsign == null)
return null;
ArrayList al = new ArrayList();
while ((index = str.indexOf(splitsign)) != -1) {
al.add(str.substring(0, index));
str = str.substring(index + splitsign.length());
}
al.add(str);
return (String[]) al.toArray(new String[0]);
}
/**
* Ìæ»»×Ö·û´®
*
* @param from String ԭʼ×Ö·û´®
* @param to String Ä¿±ê×Ö·û´®
* @param source String ĸ×Ö·û´®
* @return String Ìæ»»ºóµÄ×Ö·û´®
*/
public static String replace(String from, String to, String source) {
if (source == null || from == null || to == null)
return null;
StringBuffer bf = new StringBuffer("");
int index = -1;
while ((index = source.indexOf(from)) != -1) {
bf.append(source.substring(0, index) + to);
source = source.substring(index + from.length());
index = source.indexOf(from);
}
bf.append(source);
return bf.toString();
}
/**
* Ìæ»»×Ö·û´®£¬ÄÜÄܹ»ÔÚHTMLÒ³ÃæÉÏÖ±½ÓÏÔʾ(Ì滻˫ÒýºÅºÍСÓÚºÅ)
*
* @param str String ԭʼ×Ö·û´®
* @return String Ìæ»»ºóµÄ×Ö·û´®
*/
public static String htmlencode(String str) {
if (str == null) {
return null;
}
return replace("\"", """, replace("<", "<", str));
}
/**
* Ìæ»»×Ö·û´®£¬½«±»±àÂëµÄת»»³ÉԭʼÂ루Ìæ»»³ÉË«ÒýºÅºÍСÓںţ©
*
* @param str String
* @return String
*/
public static String htmldecode(String str) {
if (str == null) {
return null;
}
return replace(""", "\"", replace("<", "<", str));
}
private static final String _BR = "<br/>"


Ïà¹ØÎĵµ£º

½«JAVAÖеÄÊý×éת»»³ÉJS µÄÊý×é

JAVA ´úÂëÈçÏ£º
<%
        //    µÃµ½Òª×ª»»µÄÊý×é---µ±È»ÕâÀïÒ²¿ÉÒÔÊÇÆäËûÀàÐ͵ÄÊý×é
        List jsList = (List) request.getAttribute("gczbh"); 
%>
JS  ´úÂëÈçÏ£º
<script type="text/javascrip ......

javaÐÔÄÜ·ÖÎö

    Ô­ÎĵØÖ·£ºhttp://www.javaeye.com/topic/626801 Ò»Ö±ÔÞ̾Sun¶Ô´ý¼¼ÊõµÄÑϽ÷ºÍÓÅÑÅ£¨¿ÉÁ¯µÄSun£©¡£Sun JDKÖÐJava¿âµÄÔ´´úÂ룬Á¬×¢ÊͶ¼ÇåÇå³þ³þ¡¢¹æ¹æ·¶·¶£¬javadoc×¢½âµÄʹÓÃҲһ˿²»¹¶£¬¶ÁÆðÀ´ºÜÊìÊæ·þ¡£Òò´Ë£¬ÔÚÈÕ³£¹¤×÷ºÍѧϰÖУ¬¾­³£¶Á¶Á Java¿âµÄÔ´´úÂ룬²»ÒàÀÖºõ£¿Èç¹ûÓöµ½¹îÒìÎÊÌ⣬Դ´úÂë ......

java²Ù×÷Excel

½«ÏÂÔغóµÄÎļþ½â°ü£¬µÃµ½jxl.jar£¬·ÅÈëclasspath£¬°²×°¾ÍÍê³ÉÁË¡£
»ù±¾²Ù×÷
Ò»¡¢´´½¨Îļþ
ÄâÉú³ÉÒ»¸öÃûΪ“²âÊÔÊý¾Ý.xls”µÄExcelÎļþ£¬ÆäÖеÚÒ»¸ö¹¤×÷±í±»ÃüÃûΪ“µÚÒ»Ò³”£¬´óÖÂЧ¹ûÈçÏ£º
´úÂ루CreateXLS.java£©£º
//Éú³ÉExcelµÄÀà
import java.io.*;
import jxl.*;
import jxl.write. ......

JavaдµÄÌ°³ÔÉß

     ÈýÖÜÇ°£¬¾ÍÓëͬѧԼ¶¨ºÃÁË£¬»¨ÈýÖÜʱ¼äд¸öÌ°³ÔÉߣ¬¾ÍÓÃ×Ô¼ºÏÖÔÚËùѧµÄJava£¬ÎÒÏë¿ÉÒÔ°¡¡£Ñ§Ð£Àï½Ì²»³öʲô¶«Î÷£¬ÄǾÍ×Ô¼º¸ã°É£¡ÓÚÊÇÎÒÃÇÐÅÊĵ©µ©¿ªÊ¼Á˼¸Ìì¡£²»ÁÏÎåÒ»Ò»À´£¬°ÑËùÓеĶ¼À­ÏÂÁË¡£×îºóÒ»ÖÜÁË£¬Ã»°ì·¨£¬Í¨Ïü°É£¡ÓÚÊÇÁ¬Ðø¼¸Ìì¿à¸É£¬ÖÕÓÚд³öÀ´ÁË.ËäÈ»Óеã´Ö²Ú£¬ÒòΪѧУ»¹Ã»¿ªÊ¼½ÌGUIº ......

ArrayListÖеÄÊý¾ÝÅÅÐò java¶ÔÏóÅÅÐò

³£³£Óöµ½Êý×éÅÅÐòµÄÎÊÌâ.±ÈÈçÎÒÓÐÒ»¸öPersonÀà,ËüµÄʵÀý¶ÔÏó´æ´¢ÔÚArrayListÊý×éÖÐ,ÏÖÔÚÒª°ÑArrayListÊý×éÖеÄPerson¶ÔÏó°´ÕÕÄêÁäÅÅÐò.
ÆäʵÕâÖÖÇé¿ö¾­³£Óöµ½.
ÏÂÃæ¸ø³öÔ´´úÂë:
1:Person.JavaÎļþ:-------------------------------
public class Person{
String name;
int age;
public Person(String name,int age){ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ