我正在尝试使用结构数组从用户那里获得输入然后打印它:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CA4
{
class Program
{
static void Main(string[] args)
{
StudentDetails[,] student = new StudentDetails[5, 1];
Console.WriteLine("Please enter the unit code:");
student[0, 0].unitCode = Console.ReadLine();
Console.WriteLine("Please enter the unit number:");
student[1, 0].unitNumber = Console.ReadLine();
Console.WriteLine("Please enter first name:");
student[2, 0].firstName = Console.ReadLine();
Console.WriteLine("Please enter last name:");
student[3, 0].lastName = Console.ReadLine();
Console.WriteLine("Please enter student mark:");
student[4, 0].studentMark = int.Parse(Console.ReadLine());
for (int row = 0; row < 5; row++)
{
Console.WriteLine();
for …Run Code Online (Sandbox Code Playgroud) 就像在标题中一样,函数之前的感叹号在PHP中真正意味着什么?
例如,以下语句:
if (!stripos($haystack, $needle)) {}
Run Code Online (Sandbox Code Playgroud)
与此相同:
if (stripos($haystack, $needle) === FALSE) {}
或这个:
if (stripos($haystack, $needle) == FALSE) {}
任何澄清将不胜感激
在过去的几个小时中,我一直在尝试从以下示例数据中匹配地址,但无法正常工作:
medicalHistory None
address 24 Lewin Street, KUBURA,
NSW, Australia
email MaryBeor@spambob.com
address 16 Yarra Street,
LAWRENCE, VIC, Australia
name Mary Beor
medicalHistory None
phone 00000000000000000000353336907
birthday 26-11-1972
Run Code Online (Sandbox Code Playgroud)
我的计划是查找以“ address”开头,后跟任何空格,后跟字符,数字逗号和换行符,以换行符结尾,后跟字符的任何内容。我提出了以下内容(及其许多变体):
address\s+([0-9a-zA-Z, \n\t]+)(?!\n\w)
Run Code Online (Sandbox Code Playgroud)
不幸的是,它符合以下条件:
address 24 Lewin Street, KUBURA,
NSW, Australia
email MaryBeor
Run Code Online (Sandbox Code Playgroud)
和
address 16 Yarra Street,
LAWRENCE, VIC, Australia
name Mary Beor
medicalHistory None
phone 00000000000000000000353336907
birthday 26
Run Code Online (Sandbox Code Playgroud)
代替
address 24 Lewin Street, KUBURA,
NSW, Australia
Run Code Online (Sandbox Code Playgroud)
和
address 16 Yarra Street,
LAWRENCE, VIC, Australia
Run Code Online (Sandbox Code Playgroud)
你能告诉我我做错了吗?