• mwicks
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
 Hi,
In the below javascript and ASP code I'm not giving the variable name directly, it comes from ' Response.Write "a" '.


<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)"

        }
       
       
     }
Is there a way to do that?
  • April 21, 2009
  • Like
  • 0

Hi,

 

i want to make a two dimesional array in apex.  Lists or Maps are not suitable for my purpose. How can I do that?

 

Thanks

  • March 23, 2009
  • Like
  • 0