In C# there is a kind of class that is called "record" which is more or less the same as a "data" class in Kotlin.
When using a record in C# you can use the keyword "with" to create a new instance of the your record with some properties set to specific values (see https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/with-expression )
I was wondering if there is a similar way to do it in kotlin ? I cannot find anything regarding that, and the way I do it for now is by defining function that do the job, but it can be kind of boilerplate sometimes, and using data class is supposed to avoid me that boilerplate work.
Also I'd prefer to avoid using "var" properties (to have immutable instances), hence my question.