• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 566
  • Last Modified:

Convert horizontal tab (	) into a space( )

How would Achieve this? I thought I might use a replace statement but it's not playing nice with the 	.
0
longjt
Asked:
longjt
  • 4
1 Solution
 
sudhakar_koundinyaCommented:

/*
 * Created on Aug 12, 2004
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */

/**
 * @author Sudhakar
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class Test1 {
      public static void main(String s[])
      {
            System.err.println("	".replaceAll("	"," ");
            
      }
}
0
 
sudhakar_koundinyaCommented:
static String replaceWord(String original, String find, String replacement) {
          int i = original.indexOf(find);
          if (i < 0) {
              return original;  // return original if 'find' is not in it.
          }
        
          String partBefore = original.substring(0, i);
          String partAfter  = original.substring(i + find.length());
        
          return partBefore + replacement + partAfter;
      }
0
 
sudhakar_koundinyaCommented:
>>I thought I might use a replace statement but it's not playing nice with the &#09;

Should work. What is the probem you ate facing??
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
longjtAuthor Commented:
Actually I gooffed. This is an asp question. Gata love programming in multiple languages.

the error is
                   Expected end of statement
this is on line:
                   strLine3 = Replace(strLine3), "&#09;", "&nbsp;"
0
 
sudhakar_koundinyaCommented:
strLine3 = Replace(strLine3, "&#09;", "&nbsp;")
0
 
sompol_kiatkamolchaiCommented:
or ???

strLine3 = Replace strLine3, "&#09;", "&nbsp;"
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now