使用ueditor实现多图片上传案例——截取字符串层Util(SubString_text)

 /**  
* @Title: ConfigManager.java
* @Package org.util
* @Description: TODO该方法的主要作用:
* @author A18ccms A18ccms_gmail_com  
* @date 2017-9-29 上午8:01:39
* @version V1.0  
*/
package org.util;

import org.entity.Shopping;


 /**   
 *    
 * 项目名称:test_fuwenben   
 * 类名称:ConfigManager   
 * 类描述:   测试
 * 创建人:Mu Xiongxiong  
 * 创建时间:2017-9-29 上午8:01:39   
 * 修改人:Mu Xiongxiong   
 * 修改时间:2017-9-29 上午8:01:39   
 * 修改备注:   
 * @version    
 *    
 */
public class SubString_text {
		
	public static void SubString_text_picture(Object entity,String text) {
		
		Shopping shopping = (Shopping) entity;
//		text = "<p><img src=\"http://localhost:8080/test_fuwenben//ueditor/jsp/upload/image/20170930/1506774556153096952.jpg\" title=\"1506774556153096952.jpg\"/></p>" +
//				"<p><img src=\"http://localhost:8080/test_fuwenben//ueditor/jsp/upload/image/20170930/1506774556372013191.jpg\" " +
//				"title=\"1506774556372013191.jpg\"/></p><p><br/></p>";
		//截取p
		String subArray_p[] = new String []{};
		String s = new String(text);
		subArray_p = s.split("</p>");
		String picture = "";
		for (int i = 0; i < subArray_p.length; i++) {
			int title = subArray_p[i].indexOf("ueditor");
			int end = subArray_p[i].indexOf("title");
			if(title>0&&end>0){
				String picture_name = subArray_p[i].substring(title, end);
				picture+=picture_name+",";
			}
		}
		shopping.setPicture(picture);
		System.out.println("图片名称:"+picture);
	}
	
}

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

穆雄雄

哎,貌似还没开张来着呢~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值