mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +02:00
String interpolation
This commit is contained in:
parent
22cc81862b
commit
281f19e04c
15 changed files with 379 additions and 59 deletions
24
IDEHelper/Tests/src/Strings.bf
Normal file
24
IDEHelper/Tests/src/Strings.bf
Normal file
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
|
||||
namespace Tests
|
||||
{
|
||||
class Strings
|
||||
{
|
||||
static void FormatString(String outString, String format, params Object[] args)
|
||||
{
|
||||
outString.AppendF(format, params args);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public static void TestBasics()
|
||||
{
|
||||
var str0 = scope $@"AB\C";
|
||||
Test.Assert(str0 == "AB\\C");
|
||||
var str1 = scope @$"\A{100+200}B{100+200:X}";
|
||||
Test.Assert(str1 == "\\A300B12C");
|
||||
var str2 = scope String();
|
||||
FormatString(str2, $"\a{200+300}B{200+300:X}");
|
||||
Test.Assert(str2 == "\a500B1F4");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue