Finding a specific character in a string in Matlab

前端 未结 7 1113
闹比i
闹比i 2020-12-16 13:02

Suppose I have a string \'johndoe@hotmail.com\'. I want to store the string before and after \"@\" into 2 separate strings. What would be the easiest method of

相关标签:
7条回答
  • 2020-12-16 13:43

    String email = "johndoe@hotmail.com";

        String a[] = email.split("@");
        String def = null;
        String ghi = null;
        for(int i=0;i<a.length;i++){
            def = a[0];
            ghi = a[1];
        }
    
    0 讨论(0)
提交回复
热议问题