Introduction
Here is the source code for Main.java
Source
//package com.java2s;
public class Main {
public static String getUsernameFromAddress(String str) {
if (str.contains("sip:")) {
str = str.replace("sip:", "");
}
return str.contains("@") ? str.split("@")[0] : str;
}
}