Hi
I have below code & i want to store values in a string with comma separation. Last comma value also to be removed
BALStudents bALStudents = new BALStudents();
List objStudentList = bALStudents.GetAvailableStudntList(Convert.ToInt32(colum.GroupID));
if (objStudentList != null)
{
}
Thanks
Jignesh KumarPosted Mar 30, 2023, 5:41 AM
Ramco RamcoPosted Mar 30, 2023, 5:37 AM
Hi Jignesh
I have written like below . How i should remove last comma
Thanks
Jignesh KumarPosted Mar 30, 2023, 5:31 AM
Hello Ramco,
Please try this one,
Jignesh KumarPosted Mar 30, 2023, 5:25 AM
Hello Ramco,
Try this one,
Ramco RamcoPosted Mar 30, 2023, 4:45 AM
Hi
i have written below code but comma's not getting inserted between 2 names
Chilumuri - 9814604990Rana - 7738499995
Rajkiran SwainPosted Mar 29, 2023, 8:23 PM
In the given code, the
objStudentListvariable is a List ofStudentDetailobjects which are obtained by calling theGetAvailableStudntListmethod ofBALStudentsobject with a parameter ofcolum.GroupID.To extract values from the
objStudentListobject, you can use a loop like aforloop orforeachloop. Here's an example usingforeachloop to iterate over theobjStudentListand extract theNameproperty of eachStudentDetailobject:n this example, the
Nameproperty of eachStudentDetailobject is extracted and stored in thenamevariable. You can then use this variable for further processing.Jignesh KumarPosted Mar 29, 2023, 12:31 PM
Hello Ramco,
As Naimish told you can create comma seperated list using string.Join(",",ListOfValue),
string.Join(",",ListOfValue) takes two parameter
1. First Parameter Which is seperator you want to use in your case , (comma)
2. Second Parameter Which is list Object your want to club togather
Below code will gives you commaSeperated studentIds, Its depend on your requirement you can change field name.
Naimish MakwanaPosted Mar 29, 2023, 12:07 PM
Hello Ramco,
Try below:
Thanks
Naimish Makwana