You need to sign in to do that
Don't have an account?
amar kumar10
Break string and display as 2
Hi,
i have assigned a string to a variable and want to display the string in 2 lines.
expected result:
Sample code
VF Code ----------------------------------------------------------- <apex:page controller="BreakString1Controller"> <apex:outputText value="{!str2}"></apex:outputText> </apex:page> Controller code ----------------------------------------------------------------------- public class BreakString1Controller { public string str1 = 'Quick brown fox jumps \n '+' <br/>'+' over the lazy dog'; public string str2 {get; set;} public BreakString1Controller (){ str2 = str1; } }Any help would pe appreciated
replace your VF and Apex with the below codes,
VF
APEX
Regards
All Answers
replace your VF and Apex with the below codes,
VF
APEX
Regards
Try using this and let me know
<apex:outputText value="{!str2}" escape="false" />
Hi Eldon,
Its working
thanks for your help.
Hi,
If i use {!Str2} in the VF page in place of outputtext then there is any option to get my expected result.
you can use <apex:outputlabel>{!str2}</apex:outputlabel>.if you use this also you will ge same result