I want to pass Roll_no to my rest API ? I want pass Roll_no like this format:
String roll_no = '3250$10';
How to prepare this format? I have add $ between 3250 and 10 but it gives error like Expected an identifier.
If you are attempting to put a String variable inside another static String you can do the following for simple variables:
String firstString = 'sentence';
String secondString = 'This is a $firstString';
Which will output This is a sentence.
If the String is a property of an object, then you must use ${}like this:
person.name = 'Shilpa';
String newString = 'This is my name: ${person.name}';
Which will output This is my name: Shilpa.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With