package twitterSearch;
public class decode {

	public static String returnDecoded(String str){
		
		//char[] charURL=str.toCharArray();
		
		StringBuffer sb=new StringBuffer();
		for(int i=11;i<str.length();i++){
			
			
			int end=0;
			if(str.charAt(i)!='&')
			{
				sb.append(str.charAt(i));
			}
			
			else{
				
			//	int start=i;
				StringBuilder test=new StringBuilder();
				test.append("&");
				while(str.charAt(i+end)!=';')
					{
					end++;
					test.append(str.charAt(i+end));
					}
				
				//test.append(";");
				
			//	System.out.println("found"+test.toString());
			//	System.out.println();
				if((test.toString()).equals("&gt;"))
					{
					
				//	System.out.println("found");
					break;
					}
			//	System.out.println(end);
				i=i+end;
			}
			
			
			
		}
		
		return sb.toString();
	}
	
	
}

@@ -1,8 +1,139 @@
+// Author: Nilesh Singh, George Mason University%0A//This class provides a method to take a string input and returns the valid URL %0A%0A
 package 
@@ -224,47 +224,73 @@
 )%7B%0A%09
-%09%0A%09%09//char%5B%5D charURL=str.toCharArray();
+//Requires: A string input%0A%09//Effects: Returns a Valid URL string
 %0A%09%09%0A
@@ -473,27 +473,8 @@
 %09%09%09%0A
-%09%09%09//%09int start=i;%0A
 %09%09%09%09
@@ -636,260 +636,90 @@
 %09%09%7D%0A
-%09%09%09%09%0A%09%09%09%09//test.append(%22;%22);%0A%09%09%09%09%0A%09%09%09//%09System.out.println(%22found%22+test.toString());%0A%09%09%09//%09System.out.println();%0A%09%09%09%09if((test.toString()).equals(%22&gt;%22))%0A%09%09%09%09%09%7B%0A%09%09%09%09%09%0A%09%09%09%09//%09System.out.println(%22found%22);%0A%09%09%09%09%09break;%0A%09%09%09%09%09%7D%0A%09%09%09//%09System.out.println(end);
+%0A%09%09%09%09if((test.toString()).equals(%22&gt;%22))%0A%09%09%09%09%09%7B%0A%09%09%09%09%09%0A%09%09%09%09%0A%09%09%09%09%09break;%0A%09%09%09%09%09%7D%0A%09%09%09
 %0A%09%09%09
@@ -737,24 +737,16 @@
 %09%09%7D%0A%09%09%09%0A
-%09%09%09%0A%09%09%09%0A
 %09%09%7D%0A%09%09%0A%09

Update decode.java