【发布时间】:2017-05-05 14:32:57
【问题描述】:
我有以下组合作为输入,请帮助我返回输出变量的函数,如下所述
COMPANY-ID_ABC_123 ==> This should give three outputs (COMPANY-ID,ABC,123)
COMPANY-ID ==> this should give give three outputs such as (COMPANY-ID,null,null)
COMPANY-ID-FLAG ==> this should give give three outputs such as (COMPANY-ID,FLAG,null)
COMPANY-ID-FLAG-ES ==> this should give give three outputs such as (COMPANY-ID,FLAG,ES)
COMPANY-ID-ES ==> this should give give three outputs such as (COMPANY-ID,ES,null)
IOB-2003 ==> if i give any other string other than the above , it has to just display (IOB-2003,null,null)
【问题讨论】:
-
你能检查一下你写的是否正确吗? (我发现两三个奇怪的东西......例如,COMPANY-ID-FLAG 或 COMPANY-ID_FLAG?但描述中也有其他)
-
是的,COMPANY-ID 是默认值,第一个 eg 包含附加的两个其他字符串,并带有下划线 _。其余所有连字符。
-
如果是这样,请修改并编辑您的问题。澄清您是否也是实际值(例如,当您写 COMPANY-ID 时,您的意思是任何值还是只是“COMPANY_ID”?)
-
这些是我从 java 文件中收到的输入,比如 COMPANY-ID,它只是一个字符串