How to get the first five character of a String

后端 未结 20 2364
醉酒成梦
醉酒成梦 2020-12-01 05:01

I have read this question to get first char of the string. Is there a way to get the first n number of characters from a string in C#?

20条回答
  •  感动是毒
    2020-12-01 05:39

    I have tried the above answers and the best i think is this one

    @item.First_Name.Substring(0,1)
    

    In this i could get the first letter of the string

提交回复
热议问题