Greetings of the Day
ClientInformation.Substring(ClientInformation.IndexOf(“ClientId:”)+“ClientID:”.Length).Split(Environment.NewLine.ToCharArray)(0)
Can Anyone give me the explanation for this string function
Thanks
Soumiya
Greetings of the Day
ClientInformation.Substring(ClientInformation.IndexOf(“ClientId:”)+“ClientID:”.Length).Split(Environment.NewLine.ToCharArray)(0)
Can Anyone give me the explanation for this string function
Thanks
Soumiya
hello @soumi_soumiya
ClientInformation.Substring(ClientInformation.IndexOf(“ClientId:”)+“ClientID:”.Length)
above expression will give you a sub string from the main, string will start from 0th index and ends at sum of ClientInformation.IndexOf(“ClientId:”)+“ClientID:”.Length
means length will be sum of ClientInformation.IndexOf(“ClientId:”)
and “ClientID:”.Length
.Split(Environment.NewLine.ToCharArray)(0) this expression will split the resultant string from the first express based on new line char and return the string in the 0th index.
REgards
Ajay
ACME System 1 - Work Items
Client ID: AD55686
Client Name: Digna Buffaloe
Client Country: Germany
will it returns the value AD55686
name and country
Hey @soumi_soumiya
you can use below
For Client ID -
ClientInformation.Substring(ClientInformation.IndexOf("Client ID: ")+"Client ID: ".Length).Split(Environment.NewLine.ToCharArray)(0)
For Client Name -
ClientInformation.Substring(ClientInformation.IndexOf("Client Name: ")+"Client Name: ".Length).Split(Environment.NewLine.ToCharArray)(0)
For ClientCountry -
ClientInformation.Substring(ClientInformation.IndexOf("Client Country: ")+"Client Country: ".Length).Split(Environment.NewLine.ToCharArray)(0)
Regards…!!
Aksh