12

有谁熟悉在线服务,我可以在其中粘贴一些代码,它告诉我

  1. 如果我所有的括号都到位 - 没有丢失/添加右括号?
  2. 根据语言语法 - 代码是否正确?

    • 我同意大多数编辑配色方案/和或给你一个错误。这个特定的没有:-) 它被称为:记事本^^ - 我经常使用它,但仍然如此。如果存在这样的服务 - 无论您使用什么 IDE,它都可以提供帮助。如果您有一段代码要检查 - 并且不想打开 IDE

示例(“3”部分缺少括号):

IF( OR( ISBLANK(BillingCountry), UPPER(BillingCountry) = 'UNITED STATES' , UPPER(BillingCountry) = 'USA', UPPER(BillingCountry) = 'US', UPPER(BillingCountry) = 'U.S.', UPPER(BillingCountry) = 'U.S.A.' ), 

IF ( OR( BillingState = 'CA' , BillingState = 'WA' , BillingState = 'OR' , BillingState = 'ID' , BillingState = 'NV' , BillingState = 'MT' , BillingState = 'WY' , BillingState = 'CO' , BillingState = 'UT' , BillingState = 'AZ' , BillingState = 'NM'), 
"1 - West" 
,
IF ( OR( BillingState = 'IL' , BillingState = 'ND' , BillingState = 'SD' , BillingState = 'MI' , BillingState = 'NE' , BillingState = 'IA' , BillingState = 'KS' , BillingState = 'OK' , BillingState = 'TX' , BillingState = 'IL' , BillingState = 'MN' , BillingState = 'OH' , BillingState = 'WI' , BillingState = 'IN' , BillingState = 'CANADA'), 
"2 - MIDWEST" 
, 
IF( OR( BillingState = 'NY' , BillingState = 'ME' , BillingState = 'NH' , BillingState = 'MA' , BillingState = 'RI' , BillingState = 'CT' , BillingState = 'NJ' , BillingState = 'DE' , BillingState = 'D.C.' , BillingState = 'VA' , BillingState = 'WVA' , BillingState = 'NC' , BillingState = 'SC' , BillingState = 'GA' , BillingState = 'FL' , BillingState = 'VT' , BillingState = 'PA' , BillingState = 'MD' , BillingState = 'KY' , BillingState = 'TN' , BillingState = 'AR' , BillingState = 'AL' , BillingState = 'MS' , BillingState = 'LS'), 
"3 - East" 
, 
"Unknown" ) )
, 
IF( LEN(BillingCountry) > 0, "4 - International", "Unknown") 
)
4

2 回答 2

11

这可能对ideone.com有所帮助。但是你可以只安装 Notepad++

于 2012-11-04T08:23:14.733 回答
6

该网站可能有助于满足第一点:http ://www.balancebraces.com/

本网站提供检查大括号:{ }、括号:( )、括号:[ ] 和标签:< > 的选项,并为它们着色以便于识别。

于 2018-04-05T11:04:44.033 回答