RosettaCodeData/Task/Substring/Microsoft-Small-Basic/substring.basic
2026-04-30 12:34:36 -04:00

14 lines
675 B
Text

string = "Microsoft Small Basic"
n = 3
m = 7
' starting from n haracters in and of m length
TextWindow.WriteLine(Text.GetSubText(string, n, m))
' starting from n characters in, up to the end of the string
TextWindow.WriteLine(Text.GetSubTextToEnd(string, n))
' whole string minus the last character
TextWindow.WriteLine(Text.GetSubText(string, 1, Text.GetLength(string) - 1))
' starting from a known character within the string and of m length
TextWindow.WriteLine(Text.GetSubText(string, Text.GetIndexOf(string, "a"), m))
' starting from a known substring within the string and of m length
TextWindow.WriteLine(Text.GetSubText(string, Text.GetIndexOf(string, "Small"), m))