Bonjour,
je suis en train de mettre en commentaire ce que je recupere dans un string, mais le probleme est que parfois le commentaire comporte des caracteres speciales, donc je voudrais qu'a chaque saut de ligne du string recuperer, je met au debut le caractere *.
est-ce-que c'est possible svp?
voici mon code pour recuperer le string
et voici ce que je recupere pour le moment et ce que je veux en rouge
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 //On constitue une list avec tous les Comment List listCom = courant1.getChildren("Comment"); //On effectue la vérification en parcourant notre liste de Attribute Iterator iCom = listCom.iterator(); if(courant1.getChild("Comment")!=null) { while(iCom.hasNext()) { Element courant2 = (Element)iCom.next(); { newstring.append("/** \r\n*"). append(courant2.getTextTrim()). append("\r\n*/ \n"); } } }
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 /** *This field will be used to calculate the PremiumAmountCcy1, PremiumAmountCcy2, PremiumAmountCcy1Ccy2 and PremiumAmountCcy2Ccy1The NotionalInt will be calculated as follow : \\ *If the Pair.QuotationMode = direct \If PreniumType = Cash \NotionalInt = NotionalAmountCcy1 \Else NotionalInt = NotionalAmountCcy2\END If \Else \If PreniumType = Cash \NotionalInt = NotionalAmountCcy2 \Else NotionalInt = NotionalAmountCcy2/100 \END If \END If */
Partager