You need to sign in to do that
Don't have an account?
How to give apex variable names automatically by the program?
<script type="text/javascript">
var <% Response.Write "a" %>=2;
alert(a);
</script>
I want to do the same thing (Need to give the variable name as the value of "myString.replace(a,w)" ) for the commented line in this apex code.
Partner_Data__c [] str0;Partner_Data__c [] str1;
public void Test() {
String myString = 'stra';
String a='a';
for(Integer i=0;i<cpname.size();i++)
{
String w=i.format() ;
// myString.replace(a,w)=[select Fund__c,Revenue__c from Partner_Data__c where Company_ID__c=:i];
// Need to give the variable name as the value of "myString.replace(a,w)"
}