| Autor |
Mensagem |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 18/08/2011 15:14:14
|
Metaleiro
Virtual Machine Man
![[Avatar]](/images/avatar/c2155acc6d5bcda7debfb19c3abef4af.jpg)
Membro desde: 06/07/2006 10:55:54
Mensagens: 671
Localização: São Bernardo do Campo - SP
Offline
|
Alguém saberia como retirar a quebra de Linha de uma String ?
Estou passando para uma página JSP.
A JSP
Desde já agradeço !
This message was edited 1 time. Last update was at 19/08/2011 09:17:14
|
"Why, Mr. Anderson? Why do you do it? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know? Is it freedom? Or truth? Perhaps peace? Yes? No? Could it be for love? Illusions, Mr. Anderson. Vagaries of perception. The temporary constructs of a feeble human intellect trying desperately to justify an existence that is without meaning or purpose. And all of them as artificial as the Matrix itself, although only a human mind could invent something as insipid as love. You must be able to see it, Mr. Anderson. You must know it by now. You can?t win. It?s pointless to keep fighting. Why, Mr. Anderson? Why? Why do you persist?"
Neo :
-Because is my choice
|
|
|
 |
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 18/08/2011 15:34:57
|
Metaleiro
Virtual Machine Man
![[Avatar]](/images/avatar/c2155acc6d5bcda7debfb19c3abef4af.jpg)
Membro desde: 06/07/2006 10:55:54
Mensagens: 671
Localização: São Bernardo do Campo - SP
Offline
|
Encontrei exemplos como esse :
http://www.arquivodecodigos.net/dicas/java-remover-quebras-de-linhas-de-uma-string-338.html
Se alguém puder me ajudar
|
"Why, Mr. Anderson? Why do you do it? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know? Is it freedom? Or truth? Perhaps peace? Yes? No? Could it be for love? Illusions, Mr. Anderson. Vagaries of perception. The temporary constructs of a feeble human intellect trying desperately to justify an existence that is without meaning or purpose. And all of them as artificial as the Matrix itself, although only a human mind could invent something as insipid as love. You must be able to see it, Mr. Anderson. You must know it by now. You can?t win. It?s pointless to keep fighting. Why, Mr. Anderson? Why? Why do you persist?"
Neo :
-Because is my choice
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 18/08/2011 15:40:58
|
nel
JWizard
![[Avatar]](/images/avatar/1a9537e58dcb1a9913e1fc10c65c7994.jpg)
Membro desde: 01/10/2009 13:51:10
Mensagens: 2364
Offline
|
Oi!
Tente isso:
|
"Se houver a terceira guerra mundial eu não sei como será mas a quarta será com paus e pedras" Albert Einsten. |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 18/08/2011 15:52:31
|
Metaleiro
Virtual Machine Man
![[Avatar]](/images/avatar/c2155acc6d5bcda7debfb19c3abef4af.jpg)
Membro desde: 06/07/2006 10:55:54
Mensagens: 671
Localização: São Bernardo do Campo - SP
Offline
|
nel wrote:Oi!
Tente isso:
Obrigado, porém não funcionou
|
"Why, Mr. Anderson? Why do you do it? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know? Is it freedom? Or truth? Perhaps peace? Yes? No? Could it be for love? Illusions, Mr. Anderson. Vagaries of perception. The temporary constructs of a feeble human intellect trying desperately to justify an existence that is without meaning or purpose. And all of them as artificial as the Matrix itself, although only a human mind could invent something as insipid as love. You must be able to see it, Mr. Anderson. You must know it by now. You can?t win. It?s pointless to keep fighting. Why, Mr. Anderson? Why? Why do you persist?"
Neo :
-Because is my choice
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 18/08/2011 15:54:49
|
nel
JWizard
![[Avatar]](/images/avatar/1a9537e58dcb1a9913e1fc10c65c7994.jpg)
Membro desde: 01/10/2009 13:51:10
Mensagens: 2364
Offline
|
Poste o trecho de código que deseja executar tal ação com a String preenchida, por favor.
Abraços.
|
"Se houver a terceira guerra mundial eu não sei como será mas a quarta será com paus e pedras" Albert Einsten. |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 18/08/2011 16:01:32
|
Metaleiro
Virtual Machine Man
![[Avatar]](/images/avatar/c2155acc6d5bcda7debfb19c3abef4af.jpg)
Membro desde: 06/07/2006 10:55:54
Mensagens: 671
Localização: São Bernardo do Campo - SP
Offline
|
|
"Why, Mr. Anderson? Why do you do it? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know? Is it freedom? Or truth? Perhaps peace? Yes? No? Could it be for love? Illusions, Mr. Anderson. Vagaries of perception. The temporary constructs of a feeble human intellect trying desperately to justify an existence that is without meaning or purpose. And all of them as artificial as the Matrix itself, although only a human mind could invent something as insipid as love. You must be able to see it, Mr. Anderson. You must know it by now. You can?t win. It?s pointless to keep fighting. Why, Mr. Anderson? Why? Why do you persist?"
Neo :
-Because is my choice
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 18/08/2011 16:15:02
|
nel
JWizard
![[Avatar]](/images/avatar/1a9537e58dcb1a9913e1fc10c65c7994.jpg)
Membro desde: 01/10/2009 13:51:10
Mensagens: 2364
Offline
|
Metaleiro wrote:
Estamos falando de scriplets? Ai é mais complicado mesmo, porque não sei se ele pega algo da variavél de sistema "line.separator".
Veja se isso lhe ajuda:
|
"Se houver a terceira guerra mundial eu não sei como será mas a quarta será com paus e pedras" Albert Einsten. |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 18/08/2011 16:20:31
|
Metaleiro
Virtual Machine Man
![[Avatar]](/images/avatar/c2155acc6d5bcda7debfb19c3abef4af.jpg)
Membro desde: 06/07/2006 10:55:54
Mensagens: 671
Localização: São Bernardo do Campo - SP
Offline
|
Também não funcionou mas agradeço
|
"Why, Mr. Anderson? Why do you do it? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know? Is it freedom? Or truth? Perhaps peace? Yes? No? Could it be for love? Illusions, Mr. Anderson. Vagaries of perception. The temporary constructs of a feeble human intellect trying desperately to justify an existence that is without meaning or purpose. And all of them as artificial as the Matrix itself, although only a human mind could invent something as insipid as love. You must be able to see it, Mr. Anderson. You must know it by now. You can?t win. It?s pointless to keep fighting. Why, Mr. Anderson? Why? Why do you persist?"
Neo :
-Because is my choice
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 18/08/2011 18:40:45
|
JM4X
JavaChild
![[Avatar]](/images/avatar/3a5b6e4fd7d230efe454245e2d0159dd.jpg)
Membro desde: 01/07/2010 14:16:04
Mensagens: 137
Localização: São Paulo
Offline
|
não manjo de scriplets, mas tenta fazer um teste.
pegue um texto conhecido com quebra de linha, você deve saber a posição exata da quebra de linha
use o texto.charAt(x) onde x é a posição da quebra de linha.
faça um cast do resultado:
int i = (int) texto.charAt(x);
assim você vai saber codigo ascii do caracter de quebra de linha, daí é só utilizar o replaceAll...
sakou?
This message was edited 1 time. Last update was at 18/08/2011 18:41:23
|
JM4X.bye(); |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 18/08/2011 18:46:47
|
JM4X
JavaChild
![[Avatar]](/images/avatar/3a5b6e4fd7d230efe454245e2d0159dd.jpg)
Membro desde: 01/07/2010 14:16:04
Mensagens: 137
Localização: São Paulo
Offline
|
.
This message was edited 1 time. Last update was at 18/08/2011 18:48:33
|
JM4X.bye(); |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 19/08/2011 08:24:27
|
Metaleiro
Virtual Machine Man
![[Avatar]](/images/avatar/c2155acc6d5bcda7debfb19c3abef4af.jpg)
Membro desde: 06/07/2006 10:55:54
Mensagens: 671
Localização: São Bernardo do Campo - SP
Offline
|
Estou usando :
& n b s p
Porém ele evita a quebra de linha mas imprime alguns caracteres estranhos               :
QHB15GVBNLJÂ Â Â 4FMQK9HQIEGÂ Â Â Â Â 48UQIPCWW32Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
Se alguém puder me ajudar, desde já agradeço !
|
"Why, Mr. Anderson? Why do you do it? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know? Is it freedom? Or truth? Perhaps peace? Yes? No? Could it be for love? Illusions, Mr. Anderson. Vagaries of perception. The temporary constructs of a feeble human intellect trying desperately to justify an existence that is without meaning or purpose. And all of them as artificial as the Matrix itself, although only a human mind could invent something as insipid as love. You must be able to see it, Mr. Anderson. You must know it by now. You can?t win. It?s pointless to keep fighting. Why, Mr. Anderson? Why? Why do you persist?"
Neo :
-Because is my choice
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 19/08/2011 09:16:52
|
Metaleiro
Virtual Machine Man
![[Avatar]](/images/avatar/c2155acc6d5bcda7debfb19c3abef4af.jpg)
Membro desde: 06/07/2006 10:55:54
Mensagens: 671
Localização: São Bernardo do Campo - SP
Offline
|
Usei um Ext.urlEncode
Obrigado a todos !
|
"Why, Mr. Anderson? Why do you do it? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know? Is it freedom? Or truth? Perhaps peace? Yes? No? Could it be for love? Illusions, Mr. Anderson. Vagaries of perception. The temporary constructs of a feeble human intellect trying desperately to justify an existence that is without meaning or purpose. And all of them as artificial as the Matrix itself, although only a human mind could invent something as insipid as love. You must be able to see it, Mr. Anderson. You must know it by now. You can?t win. It?s pointless to keep fighting. Why, Mr. Anderson? Why? Why do you persist?"
Neo :
-Because is my choice
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 19/08/2011 13:37:34
|
Metaleiro
Virtual Machine Man
![[Avatar]](/images/avatar/c2155acc6d5bcda7debfb19c3abef4af.jpg)
Membro desde: 06/07/2006 10:55:54
Mensagens: 671
Localização: São Bernardo do Campo - SP
Offline
|
Também usei isso no JSP:
|
"Why, Mr. Anderson? Why do you do it? Why get up? Why keep fighting? Do you believe you're fighting for something? For more than your survival? Can you tell me what it is? Do you even know? Is it freedom? Or truth? Perhaps peace? Yes? No? Could it be for love? Illusions, Mr. Anderson. Vagaries of perception. The temporary constructs of a feeble human intellect trying desperately to justify an existence that is without meaning or purpose. And all of them as artificial as the Matrix itself, although only a human mind could invent something as insipid as love. You must be able to see it, Mr. Anderson. You must know it by now. You can?t win. It?s pointless to keep fighting. Why, Mr. Anderson? Why? Why do you persist?"
Neo :
-Because is my choice
|
|
|
 |
|
|