- 论坛徽章:
- 27
|
- Erlang/OTP 17 [erts-6.1] [64-bit] [smp:4:4] [async-threads:10]
- Eshell V6.1 (abort with ^G)
- 1> string:strip("fjiwfwe+++++++++",$+).
- ** exception error: no function clause matching
- string:strip("fjiwfwe+++++++++",43) (string.erl, line 339)
- 2> string:strip("fjiwfwe+++++++++",right,$+).
- "fjiwfwe"
- 3> string:strip("fjiwfwe++++++++a+",right,$+).
- "fjiwfwe++++++++a"
- 4> string:strip("fjiwfwe++++++++a+",both,$+).
- "fjiwfwe++++++++a"
- 5> string:strip("fjiwfwe++++++++a+",both,$a+).
- * 1: syntax error before: ')'
- 5> string:strip("fjiwfwe++++++++a+",both,$a$+).
- * 1: syntax error before: $+
- 5> string:strip("fjiwfwe++++++++a+",both,$a$+).
复制代码 这个应该比re的效率高些。 |
|