String contains another two strings

前端 未结 17 1557
故里飘歌
故里飘歌 2020-12-15 07:12

Is it possible to have the contain function find if the string contains 2 words or more? This is what I\'m trying to do:

string d = \"You hit someone for 50          


        
17条回答
  •  轮回少年
    2020-12-15 07:43

    So what is that you are really after? If you want to make sure that something has hit for damage (in this case), why are you not using string.Format

    string a = string.Format("You hit someone for {d} damage", damage);
    

    In this way, you have the ability to have the damage qualifier that you are looking for, and are able to calculate that for other parts.

提交回复
热议问题