Hack Forums
[.NET] Write a program to output the following pattern, 6 rows total. - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] Write a program to output the following pattern, 6 rows total. (/showthread.php?tid=6072933)



Write a program to output the following pattern, 6 rows total. - PolaR01 - Apr 29, 2020

I want the code to output:
$
$$
$$$
$$$$
$$$$$
$$$$$$

Thank you for the help!
I'm using Visual Basic


RE: Write a program to output the following pattern, 6 rows total. - xFic - Apr 29, 2020

Something like this will do it.

Code
For i As Integer = 0 To 6 - 1
   textBox1.Text += New String("$"c, i + 1) & vbCrLf
Next



RE: Write a program to output the following pattern, 6 rows total. - Cairns - Apr 30, 2020

(Apr 29, 2020 06:03 PM)xFic Wrote:  Something like this will do it.

Code
For i As Integer = 0 To 6 - 1
   textBox1.Text += New String("$"c, i + 1) & vbCrLf
Next

Write the items to a stringbuilder, then display them in the textbox control


RE: Write a program to output the following pattern, 6 rows total. - Joel - May 6, 2020

(Apr 30, 2020 11:43 AM)Cairns Wrote:  Write the items to a stringbuilder, then display them in the textbox control

Vouch. The time different between string builder and just adding a string together is literally HUGE in scale.

https://www.youtube.com/watch?v=KNVxcQtLj1Y