基本工具
稳定数字、文本、日期、数组、随机值、进程,以及“数字”“文本”等值节点
16 个类别,共 614 个节点
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 支持等级
- 第 1 级(拟定)
- 所属包
- 标准库 Foundation Primitives
标准库
数字、文本、日期、数组、列表、字典、集合与类型转换——几乎每张图都需要它们。
日期时间操作
加上时间间隔给时间日期加上一段时间间隔。加天数把时间日期按天数前后移动,天数可以是小数(0.5 即十二小时)。加小时数把时间日期按小时数前后移动,可以是小数。加微秒数把时间日期按微秒数前后移动,可以是小数。加毫秒数把时间日期按毫秒数前后移动,可以是小数。加分钟数把时间日期按分钟数前后移动,可以是小数。加月数把时间日期按整月前后移动,时刻保持不变。加秒数把时间日期按秒数前后移动,可以是小数。加计时周期数把时间日期按计时周期数前后移动,一个计时周期为 100 纳秒。加年数把时间日期按整年前后移动,月、日和时刻保持不变。比较比较两个时间日期。创建时间日期用计时周期数创建时间日期。创建日期用年、月、日创建日期。创建时刻用时和分创建时刻。创建时间间隔用计时周期数创建时间间隔。日期部分获取时间日期的日期部分。从时间日期取日期取时间日期的日历日期,去掉其时刻。从日序号取日期用天数编号创建日期,即公历中自 0001-01-01 起的天数。日获取时间日期是当月的第几天。日序号把日期表示为一个天数编号,即自 0001-01-01 起的天数;两个天数编号相减即为两者相隔的天数。星期几获取时间日期是星期几。一年中的第几天获取时间日期是当年的第几天。天数获取时间间隔的天数部分。相隔天数计算从一个日期到另一个日期相隔的日历天数。月份天数给出公历中某年某月的天数,已考虑闰年。分解把时间日期拆分为年、月、日。除以用一个数去除时间间隔,例如把它等分。绝对时长取时间间隔的绝对长度,去掉其正负号。相等检查两个时间日期是否相同。从二进制值还原从“转为二进制值”生成的数字还原时间日期,连同其时间类型。由日期和时刻组合把日期和时刻合成一个时间日期。从文件时间转换把 Windows 文件时间转换为本机所在时区的时间日期。从 UTC 文件时间转换把 Windows 文件时间转换为 UTC 时间日期。从 OLE 自动化日期转换把 OLE 自动化日期(Excel 等 Office 应用表示日期所用的数字格式)转换为时间日期。从 Unix 毫秒时间戳转换把 JavaScript 和许多 Web API 使用的毫秒级 Unix 时间戳转换回 UTC 时间日期。从 Unix 秒时间戳转换把秒级 Unix 时间戳转换回 UTC 时间日期。日期最大值Gets the largest possible value of System.DateOnly.日期最小值Gets the smallest possible value of System.DateOnly.最大值Gets the largest possible value of System.DateTime.最小值Gets the smallest possible value of System.DateTime.每计时周期纳秒数Gets the number of nanoseconds in one tick.现在Gets the current local date and time.每天计时周期数Gets the number of ticks in one day.每小时计时周期数Gets the number of ticks in one hour.每微秒计时周期数Gets the number of ticks in one microsecond.每毫秒计时周期数Gets the number of ticks in one millisecond.每分钟计时周期数Gets the number of ticks in one minute.每秒计时周期数Gets the number of ticks in one second.时刻最大值Gets the largest possible value of System.TimeOnly.时刻最小值Gets the smallest possible value of System.TimeOnly.时间间隔最大值Gets the largest possible value of System.TimeSpan.时间间隔最小值Gets the smallest possible value of System.TimeSpan.零时间间隔Gets a zero-length System.TimeSpan.今天Gets the current local date with the time set to midnight.Unix 纪元Gets the Unix epoch date and time: 1970-01-01 00:00:00 UTC.当前 UTC 时间Gets the current UTC date and time.获取时间日期格式用当前区域的每种标准格式写出时间日期,便于看出该选哪种格式。大于检查一个时间日期是否晚于另一个。大于或等于检查一个时间日期是否晚于或等于另一个。小时获取时间日期的小时(24 小时制)。小时数获取时间间隔的小时部分,即去掉整天后剩下的部分;要得到整个时间间隔折合的小时数,请用“总小时数”。是否介于两者之间检查时刻是否落在某个范围内,包括 22:00 到 06:00 这样跨过午夜的范围。是否为夏令时检查时间日期是否处于本机所在时区的夏令时内。是否为闰年判断给定年份是否为闰年。时间种类说明时间日期被标为本地时间、UTC 还是未指定。小于检查一个时间日期是否早于另一个。小于或等于检查一个时间日期是否早于或等于另一个。微秒获取时间日期的微秒部分。微秒数获取时间间隔的微秒部分,即去掉整毫秒后剩下的部分;要得到整个时间间隔折合的微秒数,请用“总微秒数”。毫秒获取时间日期的毫秒部分。毫秒数获取时间间隔的毫秒部分,即去掉整秒后剩下的部分;要得到整个时间间隔折合的毫秒数,请用“总毫秒数”。分获取时间日期的分钟。分钟数获取时间间隔的分钟部分,即去掉整小时后剩下的部分;要得到整个时间间隔折合的分钟数,请用“总分钟数”。月获取时间日期的月份。乘以把时间间隔乘以一个倍数,例如求它的三倍或一半。纳秒获取时间日期的纳秒部分。纳秒数获取时间间隔的纳秒部分,即去掉整微秒后剩下的部分。取反取时间间隔的相反数:5 分钟变成 -5 分钟,反之亦然。不相等检查两个时间日期是否不同。解析时间日期把文本解析为时间日期。解析日期把文本解析为日期。按格式解析时间日期从必须完全符合某一格式(如 "yyyy-MM-dd HH:mm:ss")的文本中读取时间日期。按格式解析日期从必须完全符合某一格式(如 "yyyy-MM-dd")的文本中读取日期。按格式解析时刻从必须完全符合某一格式(如 "HH:mm:ss")的文本中读取时刻。按格式解析时间间隔从必须完全符合某一格式(如 "c" 或 @"hh\:mm" 这样的自定义格式)的文本中读取时间间隔。解析时刻把文本解析为时刻。解析时间间隔把文本解析为时间间隔。秒获取时间日期的秒。秒数获取时间间隔的秒部分,即去掉整分钟后剩下的部分;要得到整个时间间隔折合的秒数,请用“总秒数”。指定时间种类创建一个计时周期与给定值相同、但时间类型为指定类型的新时间日期。减去计算从一个时间日期到另一个经过的时间。计时周期数把时间日期表示为一个计时周期数,便于存储或做精确运算。相隔时间计算从一个日期到另一个日期的时间,结果是以整天计的时间间隔。一天中的时刻获取时间日期的时刻,表示为自午夜起的时间间隔。从时间日期取时刻取时间日期的时刻,去掉其日期。从计时周期数取时刻用自午夜起的计时周期数创建时刻。从时间间隔取时刻把自午夜起的时间间隔转换为时刻,例如把 13 小时转换为 13:00。由天数生成时间间隔用天数创建时间间隔,天数可以是小数或负数(1.5 即一天半)。由小时数生成时间间隔用小时数创建时间间隔,可以是小数或负数。由微秒数生成时间间隔用微秒数创建时间间隔,可以是小数或负数。由毫秒数生成时间间隔用毫秒数创建时间间隔,可以是小数或负数。由分钟数生成时间间隔用分钟数创建时间间隔,可以是小数或负数。由秒数生成时间间隔用秒数创建时间间隔,可以是小数或负数。由计时周期数生成时间间隔用计时周期数创建时间间隔,一个计时周期为 100 纳秒。时间间隔转为时刻把自午夜起的时间间隔转换为时刻,例如把 13 小时转换为 13:00。转为二进制值把时间日期连同其时间类型打包成一个 64 位数字以便存储;“从二进制值还原”可把它还原。转为日期取时间日期的日历日期,去掉其时刻。转为时间日期把一个日期和一个时刻合成一个时间日期。转为文件时间把时间日期转换为 Windows 文件时间:自 1601-01-01 00:00:00 UTC 起经过的 100 纳秒间隔数。转为 UTC 文件时间把时间日期转换为 Windows 文件时间,未指定类型的值视为已是 UTC。转为本地时间把时间日期转换为本地时间。转为长日期文本按当前区域的长日期模式写出时间日期中的日期,例如美式英语中的 Saturday, June 15, 2024。转为长时间文本按当前区域的长时间模式写出时间日期中的时间,通常包含时、分、秒。转为 OLE 自动化日期把时间日期转换为 OLE 自动化日期,即 Excel 等 Office 应用表示日期所用的数字格式。转为短日期文本按当前区域的短日期模式写出时间日期中的日期,例如美式英语中的 6/15/2024。转为短时间文本按当前区域的短时间模式写出时间日期中的时间,通常包含时和分。转为文本把时间日期转换为文本。总天数获取时间间隔折合的天数,含小数部分(36 小时即 1.5)。总小时数获取时间间隔折合的小时数,含小数部分(90 分钟即 1.5)。总微秒数获取时间间隔折合的微秒数,含小数部分。总毫秒数获取时间间隔折合的毫秒数,含小数部分。总分钟数获取时间间隔折合的分钟数,含小数部分。总纳秒数获取时间间隔折合的纳秒数。总秒数获取时间间隔折合的秒数,含小数部分。转为时刻取时间日期的时刻,去掉其日期。转为时间间隔把时刻转换为自午夜起的时间间隔,例如把 13:30 转换为 13 小时 30 分钟。转为 UTC 时间把时间日期转换为协调世界时(UTC)。转为 Unix 毫秒时间戳把时间日期转换为毫秒级 Unix 时间戳:自 1970-01-01 00:00:00 UTC 起经过的整毫秒数,JavaScript 和许多 Web API 使用这种形式。转为 Unix 秒时间戳把时间日期转换为 Unix 时间戳:自 1970-01-01 00:00:00 UTC 起经过的整秒数。尝试解析时间日期尝试从文本中读取时间日期(不随机器的区域改变),失败时报告失败而不是出错中止。尝试解析日期尝试从文本中读取日期(不随机器的区域改变),失败时报告失败而不是出错中止。尝试按格式解析时间日期尝试从必须完全符合某一格式的文本中读取时间日期,失败时报告失败而不是出错中止。尝试按格式解析日期尝试从必须完全符合某一格式的文本中读取日期,失败时报告失败而不是出错中止。尝试按格式解析时刻尝试从必须完全符合某一格式的文本中读取时刻,失败时报告失败而不是出错中止。尝试按格式解析时间间隔尝试从必须完全符合某一格式的文本中读取时间间隔,失败时报告失败而不是出错中止。尝试解析时刻尝试从文本中读取时刻(不随机器的区域改变),失败时报告失败而不是出错中止。尝试解析时间间隔尝试从形如 [-][d.]hh:mm[:ss[.fffffff]] 的文本中读取时间间隔(不随机器的区域改变),失败时报告失败而不是出错中止。年获取时间日期的年份。
算术运算
原子质量单位Atomic mass constant (kg)阿伏伽德罗常数Avogadro's number (1/mol)玻尔兹曼常数Boltzmann constant (J/K)库仑常数Coulomb constant (N·m^2/C^2)自然常数 eEuler's number (e).电子质量Electron mass (kg)元电荷Elementary charge (C)法拉第常数Faraday constant (C/mol)气体常数Universal gas constant (J/(mol·K))引力常数Gravitational constant (m^3·kg^-1·s^-2)中子质量Neutron mass (kg)圆周率Archimedes' constant (π).普朗克常数Planck constant (J·s)质子质量Proton mass (kg)约化普朗克常数Reduced Planck constant (J·s)里德伯常数Rydberg constant (1/m)光速Speed of light in vacuum (m/s)标准大气压Standard atmospheric pressure (Pa)标准重力加速度Standard acceleration due to gravity on Earth (m/s^2)斯特藩-玻尔兹曼常数Stefan–Boltzmann constant (W·m^-2·K^-4)二倍圆周率 τTau (τ = 2π).真空磁导率Vacuum permeability (N/A^2)真空介电常数Vacuum permittivity (F/m)维恩位移常数Wien displacement constant (m·K)绝对值返回双精度浮点数的绝对值。反余弦返回余弦为指定数字的角度。反双曲余弦返回其双曲余弦为指定数的角。英亩转平方米Converts acres to square meters by multiplying by 4,046.8564224, the international acre.加法Adds two numbers and returns the sum.反正弦返回指定数字的正弦值所对应的角度。反双曲正弦返回其双曲正弦为指定数字的角度。反正切返回其切线为指定值的角度。四象限反正切返回其切线为两个指定数字的商的角度。反双曲正切返回其双曲正切为指定数字的角度。标准大气压转帕斯卡Converts standard atmospheres to pascals by multiplying by 101,325, the exact standard atmosphere.巴转帕斯卡Converts bar to pascals by multiplying by 100,000.大于Determines whether the first double is greater than the second double.大于或等于Determines whether the first double is greater than or equal to the second double.前一个可表示的数返回一个与指定值比较小的最大值。后一个可表示的数返回与指定值比较大的最小值。卡路里转焦耳Converts calories to joules by multiplying by 4.184, the thermochemical calorie.向上取整返回大于或等于指定双精度浮点数的最小整数值。摄氏度转华氏度Converts degrees Celsius to degrees Fahrenheit by the formula °F = °C × 9/5 + 32.摄氏度转开尔文Converts degrees Celsius to kelvins by adding 273.15.厘米转米Converts centimeters to meters by dividing by 100.限制范围返回被限制到最小值和最大值之间的值。限制到 0 到 1Limits a number to the range 0 to 1, replacing anything below 0 with 0 and anything above 1 with 1.限制到字节范围Round and clamp by absolute value to byte value range.限制到小正整数范围Clamp ushort-value floats.计算圆周率Computes PI to arbitrary accuracy (digits after decimal point).复制符号返回一个具有 x 的大小和 y 的符号的值。余弦返回指定角度的余弦值。双曲余弦返回指定角度的双曲余弦。立方根返回指定数字的立方根。立方米转升Converts cubic meters to liters by multiplying by 1,000.角度转弧度Converts degrees to radians by multiplying by π/180.除法将第一个数字除以第二个数字并返回商。电子伏特转焦耳Converts electronvolts to joules by multiplying by the elementary charge, 1.602176634e-19 (exact since the 2019 SI redefinition).等于Determines whether the first double is equal to the second double.指数函数返回e的指定幂。华氏度转摄氏度Converts degrees Fahrenheit to degrees Celsius by the formula °C = (°F − 32) × 5/9.英尺转米Converts feet to meters by multiplying by 0.3048, the exact international foot.向下取整返回小于或等于指定的双精度浮点数的最大整数值。小数部分Gives the fractional part of a number measured up from the next whole number below it, always from 0 to 1, so 2.75 gives 0.75 and -0.25 gives 0.75 (not -0.25).融合乘加返回 (x * y) + z,作为一个三元操作四舍五入。加仑转升Converts gallons to liters by multiplying by 3.785411784, the exact US liquid gallon.克转千克Converts grams to kilograms by dividing by 1,000.赫兹转千赫兹Converts hertz to kilohertz by dividing by 1,000.马力转瓦特Converts horsepower to watts by multiplying by 745.699872, the mechanical (imperial) horsepower.小时转秒Converts hours to seconds by multiplying by 3,600.IEEE 余数返回指定数字除以另一个指定数字所得到的余数。以 2 为底的整数对数返回指定数字的基数 2 整数对数。英寸转米Converts inches to meters by multiplying by 0.0254, the exact international inch.插值Linear interpolation.是否有限Tells whether a number is an ordinary finite value, as opposed to NaN (not a number) or positive or negative infinity, for example to catch the result of dividing by zero before it spreads.焦耳转卡路里Converts joules to calories by dividing by 4.184, the thermochemical calorie.焦耳转电子伏特Converts joules to electronvolts by dividing by the elementary charge, 1.602176634e-19 (exact since the 2019 SI redefinition).焦耳转千焦Converts joules to kilojoules by dividing by 1,000.开尔文转摄氏度Converts kelvins to degrees Celsius by subtracting 273.15.千克转克Converts kilograms to grams by multiplying by 1,000.千克转磅Converts kilograms to pounds by dividing by 0.45359237, the exact avoirdupois pound.千赫兹转赫兹Converts kilohertz to hertz by multiplying by 1,000.千焦转焦耳Converts kilojoules to joules by multiplying by 1,000.千米转米Converts kilometers to meters by multiplying by 1,000.千米转英里Converts kilometers to miles by dividing by 1.609344, the exact international (statute) mile.千帕转帕斯卡Converts kilopascals to pascals by multiplying by 1,000.千瓦转瓦特Converts kilowatts to watts by multiplying by 1,000.千米每小时转米每秒Converts kilometers per hour to meters per second by dividing by 3.6.线性插值Blends linearly from A to B: a T of 0 gives A, 1 gives B, and 0.5 gives the midpoint.线性插值(0 到 1 之间)Blends between two byte values, such as two color channels, by a factor from 0 to 1: 0 gives A, 1 gives B.升转立方米Converts liters to cubic meters by dividing by 1,000.升转加仑Converts liters to gallons by dividing by 3.785411784, the exact US liquid gallon.升转毫升Converts liters to milliliters by multiplying by 1,000.自然对数返回指定数字的自然对数(以e为底)。常用对数返回指定数字的以10为底的对数。以 2 为底的对数返回指定数字的以2为底的对数。最大值Returns the larger of two double-precision floating-point numbers.绝对值较大者返回两个双精度浮点数的较大幅度。米每秒转千米每小时Converts meters per second to kilometers per hour by multiplying by 3.6.米每秒转英里每小时Converts meters per second to miles per hour by dividing by 0.44704.米转厘米Converts meters to centimeters by multiplying by 100.米转英尺Converts meters to feet by dividing by 0.3048, the exact international foot.米转英寸Converts meters to inches by dividing by 0.0254, the exact international inch.米转千米Converts meters to kilometers by dividing by 1,000.米转毫米Converts meters to millimeters by multiplying by 1,000.英里每小时转米每秒Converts miles per hour to meters per second by multiplying by 0.44704.英里转千米Converts miles to kilometers by multiplying by 1.609344, the exact international (statute) mile.毫升转升Converts milliliters to liters by dividing by 1,000.毫米转米Converts millimeters to meters by dividing by 1,000.最小值返回两个双精度浮点数中较小的一个。绝对值较小者返回两个双精度浮点数的较小绝对值。分钟转秒Converts minutes to seconds by multiplying by 60.取模Mod and wrap around to be always positive.取模返回一个数字被另一个数字除后的余数。乘法计算两个数字并返回它们的乘积。近似相等Tells whether two numbers are equal apart from a tiny rounding error, which is the right test for results of floating-point arithmetic where exact equality usually fails (0.1 + 0.2 is not exactly 0.3).取相反数Flips the sign of a number, turning positive into negative and negative into positive.牛顿转磅力Converts newtons to pounds-force by dividing by 4.4482216152605, the exact pound-force.不等于Determines whether the first double is not equal to the second double.帕斯卡转标准大气压Converts pascals to standard atmospheres by dividing by 101,325, the exact standard atmosphere.帕斯卡转巴Converts pascals to bar by dividing by 100,000.帕斯卡转千帕Converts pascals to kilopascals by dividing by 1,000.磅力转牛顿Converts pounds-force to newtons by multiplying by 4.4482216152605, the exact pound-force.磅转千克Converts pounds to kilograms by multiplying by 0.45359237, the exact avoirdupois pound.幂运算返回指定数字的指定幂。弧度转角度Converts radians to degrees by multiplying by 180/π.二维伪随机数Random number generator taking two seeds; rand2(p,q) = rand2(q,p) is important倒数估计返回指定数字的倒数估计值。平方根倒数估算返回指定数字的倒数平方根估算值。在 0 到 1 之间循环Repeats a number over the range 0 (inclusive) to 1 (exclusive), so 1.25 gives 0.25 and -0.25 gives 0.75; this gives the same result as NumberRoutines.Wrap01.开方返回给定数字的指定根。舍入将双精度浮点值舍入到最接近的整数值,并将中点值舍入到最接近的偶数。乘以 2 的幂返回 x * 2^n 的高效计算。秒转小时Converts seconds to hours by dividing by 3,600.秒转分钟Converts seconds to minutes by dividing by 60.符号返回一个整数,指示双精度浮点数的符号。正弦返回指定角度的正弦值。正弦余弦返回指定角度的正弦和余弦。正弦(角度制)返回指定角度的正弦值。双曲正弦返回指定角度的双曲正弦。小于Determines whether the first double is less than the second double.小于或等于Determines whether the first double is less than or equal to the second double.更平滑的阶跃Eases a value between 0 and 1 along Ken Perlin's smootherstep curve (6t⁵ − 15t⁴ + 10t³), which is flatter at both ends than smoothstep because its curvature is also zero there; preferred for noise and for motion that should not visibly jerk at the start or end.平滑阶跃Gives 0 below Edge0, 1 above Edge1, and an S-shaped smooth transition in between, as the smoothstep function of shading languages does; use it to fade something in over a range of values.平滑阶跃(0 到 1)Eases a value between 0 and 1 along an S-shaped curve that starts and ends flat (3x² − 2x³), for smooth fades and transitions without the abrupt start and stop of a straight line.区间平滑阶跃平方千米转平方米Converts square kilometers to square meters by multiplying by 1,000,000.平方米转英亩Converts square meters to acres by dividing by 4,046.8564224, the international acre.平方米转平方千米Converts square meters to square kilometers by dividing by 1,000,000.平方根返回指定数字的平方根。减法从第一个数字中减去第二个数字并返回结果。正切返回指定角度的正切值。双曲正切Returns the hyperbolic tangent of the specified angle.0 到 1 转为字节Converts a normalized value from 0 to 1, such as a color channel, to a byte from 0 to 255, clamping values outside the range first.转为角度Converts an angle from radians to degrees (multiplying by 180/π) in single precision.转为弧度Converts an angle from degrees to radians (multiplying by π/180) in single precision, for passing degree angles to trigonometry that works in radians.截断计算指定双精度浮点数的整数部分。瓦特转马力Converts watts to horsepower by dividing by 745.699872, the mechanical (imperial) horsepower.瓦特转千瓦Converts watts to kilowatts by dividing by 1,000.环绕到范围内Wraps a coordinate into the range 0 (inclusive) to Size (exclusive), so a position that runs off one side of a tiling image or grid comes back in from the other.环绕到 0 到 1Wraps a number into the range 0 (inclusive) to 1 (exclusive) by keeping only its position within a unit cycle, so 1.25 gives 0.25 and -0.25 gives 0.75; useful for repeating patterns, looping animation time and hue.
三维向量
负无穷全一向量正无穷字节大小X 轴单位向量Y 轴单位向量Z 轴单位向量X 分量Y 分量Z 分量零向量三维向量绝对值向上取整分解相等向下取整设置分量获取长度快速获取长度获取长度平方快速获取长度倒数设置 XY设置 XZ设置 XZY设置 YX设置 YXZ设置 YZ设置 YZX设置 ZX设置 ZXY设置 ZY设置 ZYX获取哈希码归一化归一化向量快速归一化四舍五入设置分量设置 XY设置 XZ设置 XZY设置 YX设置 YXZ设置 YZ设置 YZX设置 ZX设置 ZXY设置 ZY设置 ZYX转为文本截断相加重心坐标插值计算夹角限制范围分量相等分量最大值分量最小值分量不相等叉积距离距离平方相除点积指数插值大于大于或等于线性插值小于小于或等于模长较大者模长较小者相乘加法运算除法运算相等运算显式转换大于运算大于或等于运算三维向量不等运算小于运算小于或等于运算乘法运算减法运算取负运算球面线性插值相减变换按列变换变换法线逆变换法线透视变换变换位置按行变换变换向量
文本操作
& 符号A constant for ampersand symbol.星号A constant for asterisk symbol.@ 符号A constant for at symbol.反斜杠A constant for backslash symbol.回车符A constant for carriage return symbol.冒号A constant for colon symbol.逗号A constant for comma symbol.逗号加空格A constant for comma and space symbols.短横线A constant for dash symbol.双引号A constant for double quote symbol.空文本A constant for empty string.等号A constant for equals symbol.感叹号A constant for exclamation mark symbol.哈希A constant for hash symbol.左花括号A constant for left curly brace symbol.左方括号A constant for left square bracket symbol.左圆括号A constant for left parenthesis symbol.换行符A constant for newline symbol.句点A constant for period symbol.竖线A constant for pipe symbol.问号A constant for question mark symbol.右花括号A constant for right curly brace symbol.右方括号A constant for right square bracket symbol.右圆括号A constant for right parenthesis symbol.分号A constant for semicolon symbol.单引号A constant for single quote symbol.斜杠A constant for slash symbol.空格A constant for space symbol.制表符A constant for tab symbol.下划线A constant for underscore symbol.Windows 换行符A constant for Windows-style newline symbol.转为驼峰式字符转 ASCII 字节比较与之比较拼接Append string values.包含Checks whether text exists.转为真否数组转为整数数组转为数字数组转为文本数组Converts a multiline text to an array of strings.复制到字符数组以此结尾相等转义符Given plain text representing a character literal, treat it as if it were a C# character literal.转义文本Given plain text (like that read from a file), treat it as if it were a C# literal.格式化Formats a string using a template string by replacing format placeholders with the specified values.获取字符获取哈希码转为易读文本查找位置查找任一字符的位置插入是否已规范化是否为空是否为空或空白连接文本Join string values with separator.转为短横线式查找最后位置查找任一字符的最后位置长度Get length of text.首字母小写规范化左侧填充右侧填充转为帕斯卡式正则表达式替换Replaces all occurrences of a specified regular expression pattern in the input string with a replacement string.移除替换Replaces matching text.替换换行符拆分Splits a string using a specified separator character.按行拆分Splits a string into an array using newline characters as separators, while trimming whitespace and removing empty entries.以此开头子文本Extracts part of the string.转为标题式转为字符数组转为小写转为小写(与区域无关)转为大写转为大写(与区域无关)去除首尾空白去除末尾空白去除开头空白变量名转为易读文本
数组操作
作为只读数组A read-only view of the array, for handing its contents on without letting the receiver change them.二分查找Finds a value in an array that is already sorted in ascending order, much faster than a front-to-back search on a large array.清空Resets every element of the array, in all dimensions, to its type's default: 0 for numbers, false for booleans, null for text and objects.复制数组A new array of the same type, shape and contents, so the copy can be changed without affecting the original.受约束复制Copies a run of elements from one array into another all-or-nothing: if the copy cannot complete, the destination is left exactly as it was.全部转换A new array made by passing each element through a converter, for turning an array of one type into another, such as numbers into labels.复制Copies a run of elements from one position in an array to a position in another (or the same) array, converting element types where a widening or boxing conversion allows.复制到数组Copies every element of a one-dimensional array into another array, starting at a 64-bit position in the destination.创建数组实例A new array of any element type and dimension count, where each dimension can start at an index other than 0 (for example a grid indexed from 1).按数组类型创建数组A new array of the given array type (for example a number grid type), with the given size for each of its dimensions.解析逗号分隔的真否数组解析逗号分隔的数字数组解析逗号分隔的文本名称复制为数组空数组An array with no elements, for when a result has nothing in it; the same shared instance is returned every time, so it costs no allocation.存在满足条件的项Whether at least one element passes a test, for questions such as "is any value negative?".填充Overwrites a run of elements with one value, leaving the rest of the array as it was.查找The first element, from the front, that passes a test.查找全部Every element that passes a test, as a new array, for filtering an array down to the entries you want.查找索引The position of the first element passing a test within a section of the array, searching forwards.查找最后一个The last element, searching from the back, that passes a test.查找最后索引The position of the last element that passes a test, searching from the back.折叠The whole array folded into one value: starting from the seed, function(accumulated, element), left to right.逐项执行Runs an action once for each element, front to back, for side effects such as printing or accumulating.获取枚举器An enumerator that walks every element of the array in order; a multidimensional array is walked with the last dimension changing fastest.获取长度The number of elements along one dimension, for example the number of rows (dimension 0) or columns (dimension 1) of a grid.获取大整数长度The number of elements along one dimension, as a 64-bit number.获取下界The first valid index along one dimension; 0 for ordinary arrays, other values only for arrays created with explicit lower bounds.获取上界The last valid index along one dimension, inclusive; for an ordinary array this is that dimension's length minus 1, and -1 for an empty dimension.获取值Reads the element at a position in a three-dimensional array, given as 64-bit indices.项的索引The position of the first element equal to a value within a section of the array, searching forwards.初始化Runs the element type's parameterless constructor on every element of an array of value types; for arrays of objects, numbers or other types without such a constructor it does nothing.是否固定大小Whether the array's size is fixed; always true, since an array cannot grow or shrink in place (Resize makes a new array instead).是否只读Whether the array's elements can be changed; always false for an array, because every array's elements are writable (wrap it with As Read Only for a view that cannot be written through).是否同步Whether access to the array is thread-safe on its own; always false for an array, so lock on SyncRoot when several threads share one.项的最后索引The position of the last element equal to a value within a section of a one-dimensional array of any element type that ends at a given index, searching backwards.长度The total number of elements across all dimensions of the array, so a 3 by 4 grid gives 12.大整数长度The total number of elements across all dimensions of the array, as a 64-bit number; use it instead of Length when a count could exceed the 32-bit range.创建数组创建真否数组创建数字数组创建文本数组映射Each element through a function: the array that comes back is the results, in order.最大长度The largest number of elements any single array can hold on this runtime (2,147,483,591), useful as an upper limit when checking a requested size before allocating.维数The number of dimensions of the array: 1 for a plain list of values, 2 for a grid, 3 for a volume.重复A new array holding the same value in every slot, for when you need a run of identical entries such as a row of zeros or a default label repeated.调整大小Changes an array's length by replacing it with a new array of the new size that keeps the existing elements from the front.反转Reverses the order of a run of elements in place, leaving the rest of the array as it was.设置值Writes a value into a two-dimensional array at a row and column given as 64-bit indices.排序Sorts a run of elements in place using the given comparer, leaving the rest of the array as it was.同步根The object to lock on when several threads share this array; for an ordinary array it is the array itself.全部满足条件Whether every element passes a test, for questions such as "are all values positive?".
枚举操作
添加标志Switches on the bits of Flag in Value; for a flag enum, adds that option.格式化Writes an enum value as text in a chosen style: its name, its number in decimal or hexadecimal, or its flags spelled out by name.由数值取枚举值Turns a number into the enum value with that number, for example a value read from a file or a database column.获取枚举值Every value of an enum type chosen at run time, for when you only have the type as a value rather than as the node's type argument.获取名称The declared name of Value, or empty text when no constant has that exact value (for example a combination of flags without a name of its own).获取所有名称The names of every constant the enum declares, for example to fill a drop-down list.获取基础类型The integer type an enum stores its values in, which is System.Int32 unless the enum declares otherwise.获取值列表Every value the enum declares, as a read-only list; the same values in the same order as EnumRoutines.GetValues.获取所有值Every value the enum declares, for example to go through all the choices one by one.包含标志Whether every bit set in Flag is also set in Value; for a flag enum, whether the value includes that option (or all of several combined options).是否已定义Whether Value is exactly one of the enum's named constants; use it to reject numbers that were cast or converted into the enum without matching any choice.是否为零Whether Value has no bits set at all; for a flag enum, whether no option is chosen.解析枚举Turns text into an enum value, throwing when it cannot; use EnumRoutines.TryParse when the text may be bad.移除标志Switches off the bits of Flag in Value; for a flag enum, removes that option.切换标志Flips the bits of Flag in Value: options that were on go off and options that were off come on.尝试由已定义的数值取枚举值Turns a number into the enum value with that number only if it is one of the enum's named constants; answers false for null, unconvertible or undeclared values instead of throwing.尝试由数值取枚举值Turns a number into the enum value with that number like EnumRoutines.FromValue, but answers false instead of throwing when the value is null or cannot be converted.尝试获取名称The declared name of Value, or null when no constant has that exact value; unlike EnumRoutines.GetName, this lets you tell "no name" apart from a name.尝试解析枚举Turns text into an enum value without throwing, telling you whether it succeeded; it accepts the same text as EnumRoutines.Parse, including numbers that match no named constant.尝试解析已定义的枚举Turns text into an enum value only if the result is one of the enum's named constants, so stray numbers and unnamed flag combinations are rejected; use it for validating user input.
过程式编程
顺序执行从上到下依次运行它的每个输出:一条按顺序做几件事的路径。遍历对集合中的每一项运行一次它的“下一步”路径,该项作为“当前项”;最后一项之后运行“完成”。迭代循环从“起始”到“结束”按“步长”计数,对每个数字运行一次它的“下一步”路径,该数字作为“当前值”;最后一个之后运行“完成”。条件循环只要条件为真,就反复运行它的“下一步”路径;条件为假时运行“完成”。重复按给定次数运行它的“下一步”路径,第几轮作为“当前索引”;最后一轮之后运行“完成”。分支条件成立时走“真”路径,不成立时走“假”路径。多路分支按顺序比较各个情形,走与它的值相等的那一路;都不相等时走“默认”。跳出循环立即离开最内层的循环,就像 C# 中的 break。继续下一轮结束最内层循环的这一轮,进入下一轮,就像 C# 中的 continue。尝试运行它的“尝试”路径;其中某一步失败时,运行第一个能接住这种失败的“捕获”;无论发生什么,“最终”都在之后运行;然后沿“完成”继续。自定义事件同名事件被激发时(由“激发事件”或图所运行的框架激发),开始一条自己的路径。激发事件按名称激发一个自定义事件,运行从它的“自定义事件”开始的路径。自身此图正在其上运行的实例,可以像普通值一样传给其他节点。返回在此结束例程并交回它的输出;例程的每条路径上都可以有一个“返回”。等待等待若干秒后继续。等待至等待到指定时间后继续;已过去的时间会立即继续。
基础节点
随机
随机挑选从列表中随机挑选一项,每一项的机会相同。用生成器挑选用给定的生成器从列表中挑选一项,每一项的机会相同;用“带种子的生成器”时,每次运行挑出的都相同。按权重随机挑选从列表中随机挑选一项,每一项的机会与它的权重成正比:权重为 2 的项出现的次数是权重为 1 的两倍,权重为 0 的项从不出现。用生成器按权重挑选用给定的生成器从列表中挑选一项,每一项的机会与它的权重成正比;用“带种子的生成器”时,每次运行挑出的都相同。带种子的生成器一个随机数生成器,给它同一个种子,它每次都给出同一个序列:用于每次运行都相同的挑选和数字,例如程序化关卡或测试。随机数一个从最小值起、不到最大值的随机数,其间每个值的机会相同。用生成器取数用给定的生成器抽取一个从最小值起、不到最大值的随机数;用“带种子的生成器”时,每次运行得到的数都相同。随机整数一个从最小值起、不到最大值的随机整数:掷骰子用 1 和 7。用生成器取整数用给定的生成器抽取一个从最小值起、不到最大值的随机整数;用“带种子的生成器”时,每次运行得到的数都相同。
进程
命令行程序和参数组成的命令行,按系统读取的方式加引号,用于在日志中显示“运行命令”或“启动进程”运行的内容。是否在运行用“启动进程”开始的程序是否仍在运行。运行命令用参数运行一个程序,等它结束,返回它结束时的代码和打印的内容。运行 Shell 命令通过系统的命令行解释器(Windows 上是 cmd,其他系统上是 sh)运行一行命令,等它结束,返回结束时的代码和打印的内容。启动进程用参数启动一个程序并立即继续,返回正在运行的程序,供“等待进程”“是否在运行”和“停止进程”使用。停止进程停止用“启动进程”开始的程序及它启动的所有程序;已结束的程序保持原样。等待进程等待用“启动进程”开始的程序结束,返回它结束时的代码和打印的内容。