2017-01-24 95 views

回答

3

$ new_string = str_replace(「/ n」,「」,$ String);

+0

SealaBr,你能告訴我與Java相同嗎? –

+2

@Rafael Java從哪裏來的突然?如果您有新問題,請發佈新問題。 – deceze

+0

String Str = new String(「RARA」); System.out.println(Str.replace('R','L')); – sealabr

2

你可以試試這個。

<?php 
$str = "[email protected]:900/n"; 

$str=str_replace("/n","",$str); 

echo $str; 
?> 
2
$str = '[email protected]:900/n'; 

// Using regular expression 
preg_replace('/\/n$/', '', $str); 

// Straight up string replace 
str_replace('/n', '', $str); 
2

相反則表達式中使用PHP str_replace() funtion的。

查找字符串'/n'''(empty)$String可變

<?php 

$String = "[email protected]:900/n"; 
echo $String; 
echo '<br>'; 

$new_string = str_replace('/n', '', $String); 
echo $new_string; 
相關問題