split_symbol

Function split_symbol 

Source
pub fn split_symbol(symbol: &str) -> (&str, &str)
Expand description

将合约代码拆分为交易所和合约

§参数

  • symbol - 合约代码(格式:EXCHANGE.INSTRUMENT)

§返回

(exchange, instrument) 元组

§示例

let (exchange, instrument) = split_symbol("SHFE.au2602");
assert_eq!(exchange, "SHFE");
assert_eq!(instrument, "au2602");