Change A Character In A String Using Actionscript

前端 未结 4 1780
悲哀的现实
悲哀的现实 2021-01-19 00:09

What is the opposite of String.charAt()??

If I Have a string:

var Str:String=\"Hello World\";

How do I change the 5th chara

4条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-19 00:46

    //Replacing "/" with "-"
    var str:String = "he/ll/o"
    str = str.split("/").join("-"); //str = he-ll-o
    

提交回复
热议问题