Eclipse PHP:多行字符串,返回时不自动缩进

时间:2018-08-19 23:46:48

标签: php eclipse ide

原始代码:

$sql .= " LEFT OUTER JOIN";

在“加入”之后点击“输入”,我想要的是

$sql .= " LEFT OUTER JOIN (cursor)";

我得到的是

$sql .= " LEFT OUTER JOIN (cursor)";

如何解决?

编辑:而且,即使我的标签设置没有说要这样做,Eclipse也会插入4个空格而不是一个标签。

1 个答案:

答案 0 :(得分:0)

这并不是一个完美的解决方案,但是会使事情变得更好(在Eclipse PDT 6.2中进行了测试): 在偏好设置下,转到import java.util.*; public class Main { public static void main(String[] args) { normalizeText(); obify("THISISSOMEREALLYGREATTEXT" ); } // Part 1 Normalized Method to convert all letter to uppercase and removing all special characters and placing it into String codey. public static String normalizeText (){ Scanner sc = new Scanner( System.in ); String normText; System.out.println("Please input text to encrypt"); normText = sc.nextLine(); System.out.println(normText.replaceAll(" ","").replaceAll("[^a-zA-Z ]", "").toUpperCase()); return normText; } //This method will take in the Normalized text and insert a capital O and B in-front of every vowel and return the text private static String obify (String input) { String obifiledInput = input; for (int i = 0; i < input.length(); i++) { if (input.contains( Character.toString( input.charAt( i ) ) )) { obifiledInput = obifiledInput + "OB" + Character.toString( input.charAt( i ) ); } else { obifiledInput = obifiledInput + Character.toString( input.charAt( i ) ); } System.out.println(obifiledInput); } return obifiledInput; } } 并选中PHP > Editor > Typing