File: strings.chapt.txt

package info (click to toggle)
yacas 1.3.6-2
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 7,176 kB
  • ctags: 3,520
  • sloc: cpp: 13,960; java: 12,602; sh: 11,401; makefile: 552; perl: 517; ansic: 381
file content (127 lines) | stat: -rw-r--r-- 1,924 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127

			String manipulation

*CMD StringMid'Set --- change a substring
*CORE
*CALL
	StringMid'Set(index,substring,string)

*PARMS

{index} -- index of substring to get

{substring} -- substring to store

{string} -- string to store substring in.

*DESC

Set (change) a part of a string. It leaves the original alone, returning
a new changed copy.

*E.G.

	In> StringMid'Set(3,"XY","abcdef")
	Out> "abXYef";

*SEE StringMid'Get, Length

*CMD StringMid'Get --- retrieve a substring
*CORE
*CALL
	StringMid'Get(index,length,string)

*PARMS

{index} -- index of substring to get

{length} -- length of substring to get

{string} -- string to get substring from

*DESC

{StringMid'Get} returns a part of a string. Substrings can also be
accessed using the {[]} operator.

*E.G.

	In> StringMid'Get(3,2,"abcdef")
	Out> "cd";
	In> "abcdefg"[2 .. 4]
	Out> "bcd";

*SEE StringMid'Set, Length

*CMD String --- convert atom to string
*CMD Atom --- convert string to atom
*CORE
*CALL
	Atom("string")
	String(atom)

*PARMS

{atom} -- an atom

{"string"} -- a string

*DESC

Returns an atom with the string representation given
as the evaluated argument. Example: {Atom("foo");} returns
{foo}.

{String} is the inverse of {Atom}: turns {atom} into {"atom"}.

*E.G.

	In> String(a)
	Out> "a";
	In> Atom("a")
	Out> a;

*CMD ConcatStrings --- concatenate strings
*CORE
*CALL
	ConcatStrings(strings)

*PARMS

{strings} -- one or more strings

*DESC

Concatenates strings.

*E.G.

	In> ConcatStrings("a","b","c")
	Out> "abc";

*SEE :


*CMD PatchString --- execute commands between {<?} and {?>} in strings
*CORE
*CALL
	PatchString(string)

*PARMS

{string} -- a string to patch

*DESC

This function does the same as PatchLoad, but it works on a string
in stead of on the contents of a text file. See PatchLoad for more
details.

*E.G.

	In> PatchString("Two plus three \
	  is <? Write(2+3); ?> ");
	Out> "Two plus three is 5 ";

*SEE PatchLoad