function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sekharasekhara 

Help on Trimming the text data from database.

Hi  to all,

 

I unable to trim the String data while taking in to visualforce page .

 

Eg :

1-a 

11-a

111-a

 

I have to trim the values up to Hyphon i.e., i have to remove {(1-)(11-)(111-)} and  i have to display {(a)(a)(a)}

 

   

<apex:outputText value="{0,trim('-')}">         <apex:param value="{!time}" />    </apex:outputText>

 

But i am getting error as :

 

The value attribute on <apex:outputText> is not in a valid format. It must be a positive number, and of type Number, Date, Time, or Choice.

 

Can any one help on this.

RajiRaji

Hi,

 

i dont know Exactly whether your requirement will meet this Code or not just paste it in systemlog any try it.

 

string strvalue='1-a 11-a 111-a';
list<string> lstS=strvalue.split('-');
list<string> lstS1=new list<string>();
list<string> lstS2=new list<string>();
for(String S:lstS){
       lstS1=S.split('1');
     for(string S1:lstS1){
                    lstS2.add(S1);
      }    
}
system.debug('lstS2****'+lstS2);




 Regards,

VNath