Expand|Select|Wrap|Line Numbers
- public String DisplayinURLFormat(String sampleString,int urlIndex)
- {
- String tempString = "";
- int beginIndex = sampleString.indexOf("http", urlIndex);
- if(beginIndex!=-1)
- {
- int endIndex = sampleString.indexOf(' ', beginIndex);
- if(endIndex==-1)
- {
- endIndex = sampleString.length();
- }
- String hyperString = sampleString.substring(beginIndex,endIndex);
- tempString = sampleString.substring(0, beginIndex)+"<a href='" + hyperString + "'>"+hyperString+"</a>" + sampleString.substring( endIndex,sampleString.length());
- urlIndex = endIndex + hyperString.length() + 13;
- sampleString= tempString;
- return DisplayinURLFormat(sampleString,urlIndex);
- }
- else
- return sampleString;
- }
like if i enter sampleStruing as "go to http://www.google.com" the http string shud appear in URl. but for this i need to use the escapeXml flag in HTML to ignore the conversion of < and > characters. Is there any other way to make the escaped in JAV code itself