本文主要是介绍apex如何保存多行字符串,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
虽然可以用换行符把很长的字符串放在一行,但是不便于阅读。apex没有像python中三个引号这种直接支持多行字符串的格式,可以用下面这种方法:
String query = 'SELECT Project__c,'+ ' Project__r.Testing_Submitted__c,'+ ' Project__r.Project_Sub_Phase__c,'+ ' Project__r.DRD_Submited__c,'+ ' Protected_Application__r.DRD_Completed__c,'+ ' Protected_Application__c,'+ ' Project__r.Id,'+ ' Project__r.Name,'+ ' Project__r.Project_Type__c,'+ ' Project__r.Remark__c,'+ ' Project__r.Record_Type_Name__c,'+ ' Project__r.RecordTypeId,'+ ' Project__r.Project_Actual_Completion__c,'+ ' Protected_Application__r.Application__c,'+ ' Project__r.Project_Phase__c,'+ ' Project__r.Ready_for_Testing__c,'+ ' Project__r.recordType.DeveloperName,'+ ' Project__r.Project_Sub_Status__c,'+ ' Project__r.Certification_was_submitted__c,'+ ' Project__r.Customer_confirmed_launch_date__c,'+ ' Protected_Application__r.Application_Type__c'+ ' FROM ProjectAppLink__c ';System.debug(query);
参考:https://salesforce.stackexchange.com/questions/150674/break-line-on-a-string
这篇关于apex如何保存多行字符串的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!