我的字符串 AusVELS - EAL - A阶段 - 阅读
我想将其转换为 AusVELSEALStageAReading
我试过以下
assessment = "AusVELS - EAL – Stage A - Reading";
trimassessment = assessment.replace(/\s/g, '').replace('/\-/g', '');
结果是 AusVELS-EAL-StageA-Reading
有人能告诉我正确的正则表达式吗?
答案 0 :(得分:2)
trimasssesment = assessment.replace(/[^\w]/g, '')