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
Hardik ChavdaHardik Chavda 

Can we split string in visualforce page?

I've one requirement in which I have to split a string in visualforce page. Following is what I need.
I'm using one datatable in page. which contains one field of string data type. based on that field I want to show another field. Following is what I tried.
<apex:dataTable value="{!QATlst}" var="Ass">

                           <apex:variable var="name" value="{!Ass.Benchmark_Name__c}"/>

                                    <apex:column style="text-align: left;" width="45%">
                    
                                            <apex:facet name="header">Metric Name</apex:facet>
                    
                                            <apex:outputText styleClass="colData" value="{!Ass.Benchmark_Name__c}" style="font-size:14px"/>
                                      
                    
                                    </apex:column>
                                    <apex:column style="text-align:center;" width="5%">
                    
                                            <apex:facet name="header" >Industry Benchmark </apex:facet>
                    
                                            <apex:outputText styleClass="colData" value="{0, number, 0.00}" style="font-size:14px">
                                                <apex:param value="(!if(Contains(name,'Average')),{!Ass.Average_median_value__c},{!Ass.Customer_input_Transformed_value__c})" />
                                            </apex:outputText>
                    
</apex:column>
                                    
</apex:dataTable>
So here, If the field record contains "Average" then It'll show other field and if it doesn't contain "Average" then it'll show another field. Anyone can help me with this??
Rahul SharmaRahul Sharma
Can you explain your problem, Its bit confusing. Try giving some examples.
Suraj GharatSuraj Gharat
Try below expression in param's value:
 
{!IF(Contains(name,'Average'),Ass.Average_median_value__c,Ass.Customer_input_Transformed_value__c)}