• 使用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);
    	}
    	
    }
    

  • 相关阅读:
    STM32 Systick定时器
    STM32F10X_CL
    公司版STM32工作原理
    STM32外部中断实验
    STM32的串口通信
    STM32调试过程中常见的问题及解决方法
    【转】 STM32 入门教程 系统时钟 SysTick
    STM32学习5 FLASH编程
    STM32学习笔记之Systick
    STM32 USART 串口简单使用
  • 原文地址:https://www.cnblogs.com/a1111/p/12816151.html
Copyright © 2020-2023  润新知